summaryrefslogtreecommitdiffstats
path: root/src/cache.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2007-05-18 19:33:40 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2007-05-18 19:33:40 +0000
commit2932c6b8e6952ae84b221b854b43810c61e5c8fa (patch)
tree1ee7f364f74f2dff2b462ab01868a74fd87f1403 /src/cache.c
parent34d1c62cd414a6d3321d9a51fc6e1d61f36da2f0 (diff)
- remove dead code sync-mode.c
- flush nack queue in the conntrackd -f path - do not increase add_fail counter for EEXIST errors - cleanup sync-nack code - improve mcast_recv_netmsg: sanity check before checksumming!
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cache.c b/src/cache.c
index 6f7442b..32caee5 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -228,7 +228,7 @@ static struct us_conntrack *__add(struct cache *c, struct nf_conntrack *ct)
data += c->features[i]->size;
}
- if (c->extra)
+ if (c->extra && c->extra->add)
c->extra->add(u, ((void *) u) + c->extra_offset);
return u;
@@ -247,7 +247,8 @@ struct us_conntrack *__cache_add(struct cache *c, struct nf_conntrack *ct)
c->add_ok++;
return u;
}
- c->add_fail++;
+ if (errno != EEXIST)
+ c->add_fail++;
return NULL;
}
@@ -281,7 +282,7 @@ static struct us_conntrack *__update(struct cache *c, struct nf_conntrack *ct)
data += c->features[i]->size;
}
- if (c->extra)
+ if (c->extra && c->extra->update)
c->extra->update(u, ((void *) u) + c->extra_offset);
if (nfct_attr_is_set(ct, ATTR_STATUS))
@@ -380,7 +381,7 @@ static int __del(struct cache *c, struct nf_conntrack *ct)
data += c->features[i]->size;
}
- if (c->extra)
+ if (c->extra && c->extra->destroy)
c->extra->destroy(u, ((void *) u) + c->extra_offset);
hashtable_del(c->h, u);