From 6ceaa21f2a40cce6a9c45e99a9164618250fe6a3 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 14 Jan 2009 14:29:48 +0100 Subject: 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 --- src/netlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/netlink.c') 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) -- cgit v1.2.3