diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-10-21 12:00:27 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-10-21 12:00:27 +0200 |
commit | 4eaebf5ef25f97cc6960da9f1a29b61737da8abd (patch) | |
tree | e28f06c05e5a722e3a2a6de4b42f54bc3d72a81a /include/libmnl | |
parent | 781a9f058327730723525d3c4b85533920a00e9b (diff) | |
download | libmnl-4eaebf5ef25f97cc6960da9f1a29b61737da8abd.tar.gz libmnl-4eaebf5ef25f97cc6960da9f1a29b61737da8abd.zip |
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 <pablo@netfilter.org>
Diffstat (limited to 'include/libmnl')
-rw-r--r-- | include/libmnl/libmnl.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h index 09099a1..f658428 100644 --- a/include/libmnl/libmnl.h +++ b/include/libmnl/libmnl.h @@ -11,6 +11,7 @@ */ #define MNL_SOCKET_AUTOPID 0 +#define MNL_SOCKET_BUFFER_SIZE 8192UL /* see linux/netlink.h */ struct mnl_socket; |