diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-07-21 14:36:18 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-07-21 14:36:18 +0200 |
commit | 0521db731c0daa417a3dfb67fba7c6f80596e553 (patch) | |
tree | 92553f757ba63a0755225befa7c832aae10aeacb /src/netlink.c | |
parent | 441342f4701a4bbc41c24721d4c60b857e1c5d1e (diff) | |
download | conntrack-tools-0521db731c0daa417a3dfb67fba7c6f80596e553.tar.gz conntrack-tools-0521db731c0daa417a3dfb67fba7c6f80596e553.zip |
conntrackd: add clause to enable ctnetlink reliable event delivery
This patch adds the NetlinkEventsReliable clause, this is useful
to turn on reliable Netlink event delivery. This features
requires a Linux kernel >= 2.6.31.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/netlink.c')
-rw-r--r-- | src/netlink.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/netlink.c b/src/netlink.c index 5c07201..a43f782 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -75,6 +75,18 @@ struct nfct_handle *nl_init_event_handler(void) CONFIG(netlink_buffer_size_max_grown) = 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; } |