summaryrefslogtreecommitdiff
path: root/src/netlink.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-04-09 15:25:59 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-04-09 15:25:59 +0000
commit5e5d8cdb3cfed98f1af3f3e265220c90df684674 (patch)
tree7515c853a8462a4ed13b788c20c231c53c0e651c /src/netlink.c
parent92701a6b224c533346f233061226bee5bb29a5dd (diff)
downloadconntrack-tools-5e5d8cdb3cfed98f1af3f3e265220c90df684674.tar.gz
conntrack-tools-5e5d8cdb3cfed98f1af3f3e265220c90df684674.zip
improve netlink overrun handling
Diffstat (limited to 'src/netlink.c')
-rw-r--r--src/netlink.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/netlink.c b/src/netlink.c
index 1ab75e4..10c4643 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -158,6 +158,21 @@ int nl_init_dump_handler(void)
return 0;
}
+int nl_init_overrun_handler(void)
+{
+ STATE(overrun) = nfct_open(CONNTRACK, 0);
+ if (!STATE(overrun))
+ return -1;
+
+ fcntl(nfct_fd(STATE(overrun)), F_SETFL, O_NONBLOCK);
+
+ nfct_callback_register(STATE(overrun),
+ NFCT_T_ALL,
+ STATE(mode)->overrun,
+ NULL);
+ return 0;
+}
+
static int warned = 0;
void nl_resize_socket_buffer(struct nfct_handle *h)
@@ -195,6 +210,12 @@ int nl_dump_conntrack_table(void)
return nfct_query(STATE(dump), NFCT_Q_DUMP, &CONFIG(family));
}
+int nl_overrun_request_resync(void)
+{
+ int family = CONFIG(family);
+ return nfct_send(STATE(overrun), NFCT_Q_DUMP, &family);
+}
+
int nl_exist_conntrack(struct nf_conntrack *ct)
{
int ret;