summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-05-31 16:58:58 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2008-05-31 16:58:58 +0200
commitdb4f1eb7b2c6cfa32ef76ba6be05d5ff9a2fca87 (patch)
tree5a725b2244a7643b45becad91cc1dfe73f9d3df0 /src/cache.c
parent96fad1b1ca9e6e34e439cdb9eaecb765fb107ea8 (diff)
downloadconntrack-tools-db4f1eb7b2c6cfa32ef76ba6be05d5ff9a2fca87.tar.gz
conntrack-tools-db4f1eb7b2c6cfa32ef76ba6be05d5ff9a2fca87.zip
increase deletion stats when the timer is scheduled in cache_del_timeout()
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cache.c b/src/cache.c
index fe5fd27..c72afd8 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -360,10 +360,8 @@ int cache_del(struct cache *c, struct nf_conntrack *ct)
static void __del_timeout(struct alarm_block *a, void *data)
{
struct us_conntrack *u = (struct us_conntrack *) data;
- struct cache *c = u->cache;
__del2(u->cache, u);
- c->del_ok++;
}
struct us_conntrack *
@@ -382,6 +380,13 @@ cache_del_timeout(struct cache *c, struct nf_conntrack *ct, int timeout)
if (u) {
if (!alarm_pending(&u->alarm)) {
add_alarm(&u->alarm, timeout, 0);
+ /*
+ * increase stats even if this entry was not really
+ * removed yet. We do not want to make people think
+ * that the replication protocol does not work
+ * properly.
+ */
+ c->del_ok++;
return u;
}
}