summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-01-14 14:29:48 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2009-01-14 14:29:48 +0100
commit6ceaa21f2a40cce6a9c45e99a9164618250fe6a3 (patch)
treeb80543164ef3ab469cf59757144a114bcacc5066
parent7a817e883baad98069d31bc846383f18bbfca33e (diff)
netlink: don't double the netlink buffer twice during resize
The Linux kernel doubles the the size of the buffer by default. See sock_setsockopt() in net/core/sock.c. We don't need to multiply the current size by two. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/netlink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/netlink.c b/src/netlink.c
index e164dd7..92fbf00 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -118,7 +118,8 @@ static int warned = 0;
void nl_resize_socket_buffer(struct nfct_handle *h)
{
- unsigned int s = CONFIG(netlink_buffer_size) * 2;
+ /* sock_setsockopt in net/core/sock.c doubles the size of the buffer */
+ unsigned int s = CONFIG(netlink_buffer_size);
/* already warned that we have reached the maximum buffer size */
if (warned)