[conntrack-tools] increase deletion stats when the timer is scheduled in cache_del_timeout()

Pablo Neira netfilter-cvslog-bounces at lists.netfilter.org
Sat May 31 17:11:55 CEST 2008


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=conntrack-tools.git;a=commit;h=db4f1eb7b2c6cfa32ef76ba6be05d5ff9a2fca87
commit db4f1eb7b2c6cfa32ef76ba6be05d5ff9a2fca87
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Sat May 31 16:58:58 2008 +0200
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Sat May 31 16:58:58 2008 +0200

    increase deletion stats when the timer is scheduled in cache_del_timeout()
       via  db4f1eb7b2c6cfa32ef76ba6be05d5ff9a2fca87 (commit)
      from  96fad1b1ca9e6e34e439cdb9eaecb765fb107ea8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit db4f1eb7b2c6cfa32ef76ba6be05d5ff9a2fca87
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Sat May 31 16:58:58 2008 +0200

    increase deletion stats when the timer is scheduled in cache_del_timeout()

-----------------------------------------------------------------------

 src/cache.c |    9 +++++++--
 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;
 		}
 	}



More information about the netfilter-cvslog mailing list