summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2010-07-07 14:42:22 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2010-07-07 14:42:22 +0200
commit5bec6c7dbc3bafd5befa60381d2e6b743b7b4b98 (patch)
treeb1413a4eba2aaa5804823612c33d83a7f99502c3 /src
parenta5c2a83f907a6a82912165bf2ef67ded13e84bc1 (diff)
downloadconntrack-tools-5bec6c7dbc3bafd5befa60381d2e6b743b7b4b98.tar.gz
conntrack-tools-5bec6c7dbc3bafd5befa60381d2e6b743b7b4b98.zip
conntrackd: setup event reliability after handler creation
This patch enables the event reliability in an early stage of the event handler initialization. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/netlink.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/netlink.c b/src/netlink.c
index f564436..1810f4a 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -36,6 +36,19 @@ struct nfct_handle *nl_init_event_handler(void)
if (h == NULL)
return NULL;
+ if (CONFIG(netlink).events_reliable) {
+ int on = 1;
+
+ setsockopt(nfct_fd(h), SOL_NETLINK,
+ NETLINK_BROADCAST_SEND_ERROR, &on, sizeof(int));
+
+ setsockopt(nfct_fd(h), SOL_NETLINK,
+ NETLINK_NO_ENOBUFS, &on, sizeof(int));
+
+ dlog(LOG_NOTICE, "reliable ctnetlink event delivery "
+ "is ENABLED.");
+ }
+
if (STATE(filter)) {
if (CONFIG(filter_from_kernelspace)) {
if (nfct_filter_attach(nfct_fd(h),
@@ -78,18 +91,6 @@ struct nfct_handle *nl_init_event_handler(void)
dlog(LOG_NOTICE, "netlink event socket buffer size has been set "
"to %u bytes", CONFIG(netlink_buffer_size));
- if (CONFIG(netlink).events_reliable) {
- int on = 1;
-
- setsockopt(nfct_fd(h), SOL_NETLINK,
- NETLINK_BROADCAST_SEND_ERROR, &on, sizeof(int));
-
- setsockopt(nfct_fd(h), SOL_NETLINK,
- NETLINK_NO_ENOBUFS, &on, sizeof(int));
-
- dlog(LOG_NOTICE, "reliable ctnetlink event delivery "
- "is ENABLED.");
- }
return h;
}