summaryrefslogtreecommitdiff
path: root/src/stats-mode.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-02-06 17:43:40 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2009-02-06 17:43:40 +0100
commitba2f8458ecfa0827e09a1c40c9e29868239fafa1 (patch)
tree1e9446c0b3dd93a570af2a2a9fec678ca14ab05d /src/stats-mode.c
parentc3ef4d9b32ca653571f0976f73aaa99218a36db0 (diff)
downloadconntrack-tools-ba2f8458ecfa0827e09a1c40c9e29868239fafa1.tar.gz
conntrack-tools-ba2f8458ecfa0827e09a1c40c9e29868239fafa1.zip
src: re-work polling strategy
This patch improves the polling support included in 0.9.10. The polling now consists of getting the state table, wait for PollSecs, then purge obsolete entries, and so on. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/stats-mode.c')
-rw-r--r--src/stats-mode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stats-mode.c b/src/stats-mode.c
index 226a6b8..bd20253 100644
--- a/src/stats-mode.c
+++ b/src/stats-mode.c
@@ -123,11 +123,11 @@ static int resync_stats(enum nf_conntrack_msg_type type,
static int purge_step(void *data1, void *data2)
{
- int ret;
struct cache_object *obj = data2;
- ret = nfct_query(STATE(dump), NFCT_Q_GET, obj->ct);
- if (ret == -1 && errno == ENOENT) {
+ STATE(get_retval) = 0;
+ nl_get_conntrack(STATE(get), obj->ct); /* modifies STATE(get_retval) */
+ if (!STATE(get_retval)) {
debug_ct(obj->ct, "purge stats");
cache_del(STATE_STATS(cache), obj);
cache_object_free(obj);