summaryrefslogtreecommitdiff
path: root/src/run.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-08-07 14:52:41 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2008-08-07 14:52:41 +0200
commita4f4647b4b7f32f2d1caab98544802c8cdd7b4d6 (patch)
treeb311464dece10f101291903bd420d813c9cb8252 /src/run.c
parentba0b4bc3d49cebf3ef69c7bc5b6dfd8decb6c8ca (diff)
downloadconntrack-tools-a4f4647b4b7f32f2d1caab98544802c8cdd7b4d6.tar.gz
conntrack-tools-a4f4647b4b7f32f2d1caab98544802c8cdd7b4d6.zip
netlink: add getter and check existence functions
This patch adds nl_get_conntrack and it changes the behaviour of nl_exist_conntrack. Now, nl_get_conntrack requests the kernel for a conntrack and updates the cached entry. On the other hand, nl_exist_conntrack only inquiries for the existence of the entry. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/run.c')
-rw-r--r--src/run.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/run.c b/src/run.c
index cf570d8..b7da18c 100644
--- a/src/run.c
+++ b/src/run.c
@@ -38,6 +38,7 @@ void killer(int foo)
sigprocmask(SIG_BLOCK, &STATE(block), NULL);
nfct_close(STATE(event));
+ nfct_close(STATE(request));
ct_filter_destroy(STATE(us_filter));
local_server_destroy(&STATE(local));
@@ -144,6 +145,13 @@ init(void)
return -1;
}
+ if (nl_init_request_handler() == -1) {
+ dlog(LOG_ERR, "can't open netlink handler: %s",
+ strerror(errno));
+ dlog(LOG_ERR, "no ctnetlink kernel support?");
+ return -1;
+ }
+
init_alarm(&STATE(overrun_alarm), NULL, do_overrun_alarm);
STATE(fds) = create_fds();