From db4f1eb7b2c6cfa32ef76ba6be05d5ff9a2fca87 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 31 May 2008 16:58:58 +0200 Subject: increase deletion stats when the timer is scheduled in cache_del_timeout() --- src/cache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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; } } -- cgit v1.2.3