summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-12-17 18:35:21 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-12-17 18:35:21 +0100
commit2d4cd609f22dc156b5b6e2a5db2d3d11bdb8163d (patch)
treebcdaaa0f3fa72aa98982f756985aae908bb96fca
parent7a7742b5dfe89caefa62a79f12dc0be971057d45 (diff)
netlink: log report initial netlink event socket buffer size
This patch adds an initial log message to report the initial netlink event socket buffer size. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/netlink.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/netlink.c b/src/netlink.c
index 8930e39..4fe0498 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -53,10 +53,10 @@ struct nfct_handle *nl_init_event_handler(void)
fcntl(nfct_fd(h), F_SETFL, O_NONBLOCK);
/* set up socket buffer size */
- if (CONFIG(netlink_buffer_size))
- nfnl_rcvbufsiz(nfct_nfnlh(h),
- CONFIG(netlink_buffer_size));
- else {
+ if (CONFIG(netlink_buffer_size)) {
+ CONFIG(netlink_buffer_size) =
+ nfnl_rcvbufsiz(nfct_nfnlh(h), CONFIG(netlink_buffer_size));
+ } else {
socklen_t socklen = sizeof(unsigned int);
unsigned int read_size;
@@ -67,6 +67,9 @@ struct nfct_handle *nl_init_event_handler(void)
CONFIG(netlink_buffer_size) = read_size;
}
+ dlog(LOG_NOTICE, "netlink event socket buffer size has been set "
+ "to %u bytes", CONFIG(netlink_buffer_size));
+
/* ensure that maximum grown size is >= than maximum size */
if (CONFIG(netlink_buffer_size_max_grown) < CONFIG(netlink_buffer_size))
CONFIG(netlink_buffer_size_max_grown) =
@@ -138,9 +141,8 @@ void nl_resize_socket_buffer(struct nfct_handle *h)
CONFIG(netlink_buffer_size) = nfnl_rcvbufsiz(nfct_nfnlh(h), s);
/* notify the sysadmin */
- dlog(LOG_NOTICE, "netlink socket buffer size "
- "has been set to %u bytes",
- CONFIG(netlink_buffer_size));
+ dlog(LOG_NOTICE, "netlink socket buffer size has been increased "
+ "to %u bytes", CONFIG(netlink_buffer_size));
}
int nl_dump_conntrack_table(struct nfct_handle *h)