path: root/examples/netfilter
diff options
authorPablo Neira Ayuso <>2010-10-21 12:00:27 +0200
committerPablo Neira Ayuso <>2010-10-21 12:00:27 +0200
commit4eaebf5ef25f97cc6960da9f1a29b61737da8abd (patch)
treee28f06c05e5a722e3a2a6de4b42f54bc3d72a81a /examples/netfilter
parent781a9f058327730723525d3c4b85533920a00e9b (diff)
src: define MNL_SOCKET_BUFFER_SIZE to 8192UL
Davem spotted during the Netfilter Workshop that user-space applications should use 8KB buffers for recv(). I accidentally found that NFLOG is not following this approach (in this case we're using 131072 bytes messages), we have to document this. Anyway, according to linux/netlink.h (and to complete this log message): "skb should fit one page. This choice is good for headerless malloc. But we should limit to 8K so that userspace does not have to use enormous buffer sizes on recvmsg() calls just to avoid MSG_TRUNC when PAGE_SIZE is very large." Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'examples/netfilter')
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/netfilter/nf-queue.c b/examples/netfilter/nf-queue.c
index 1df004a..8b1a5e7 100644
--- a/examples/netfilter/nf-queue.c
+++ b/examples/netfilter/nf-queue.c
@@ -167,7 +167,7 @@ nfq_build_verdict(char *buf, int id, int queue_num, int verd)
int main(int argc, char *argv[])
struct mnl_socket *nl;
- char buf[getpagesize()];
struct nlmsghdr *nlh;
int ret;
unsigned int portid, queue_num;
diff --git a/examples/netfilter/nfct-event.c b/examples/netfilter/nfct-event.c
index 9dcf6cc..c713946 100644
--- a/examples/netfilter/nfct-event.c
+++ b/examples/netfilter/nfct-event.c
@@ -208,7 +208,7 @@ static int data_cb(const struct nlmsghdr *nlh, void *data)
int main()
struct mnl_socket *nl;
- char buf[getpagesize()];
int ret;
nl = mnl_socket_open(NETLINK_NETFILTER);