summaryrefslogtreecommitdiff
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-11-25 18:08:02 +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-11-25 18:08:02 +0000
commit3c5e35974c65f4470e6543c2cc772c0f1824dc44 (patch)
tree11fd67edbffc4c626af730738465108f965eb863 /src/cache.c
parent66cd168df39bfcf581bb36250a080a66331ee5cd (diff)
downloadconntrack-tools-3c5e35974c65f4470e6543c2cc772c0f1824dc44.tar.gz
conntrack-tools-3c5e35974c65f4470e6543c2cc772c0f1824dc44.zip
Add CacheWriteThrough clause: external cache write through policy. This feature is particularly useful for active-active setup without connection persistency, ie. you cannot know which firewall would filter a packet that belongs to a connection.
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/cache.c b/src/cache.c
index 1e20d95..80cde01 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -110,6 +110,7 @@ static int compare6(const void *data1, const void *data2)
struct cache_feature *cache_feature[CACHE_MAX_FEATURE] = {
[TIMER_FEATURE] = &timer_feature,
[LIFETIME_FEATURE] = &lifetime_feature,
+ [WRITE_THROUGH_FEATURE] = &writethrough_feature,
};
struct cache *cache_create(char *name,
@@ -263,14 +264,6 @@ static struct us_conntrack *__update(struct cache *c, struct nf_conntrack *ct)
int i;
void *data = u->data;
- for (i = 0; i < c->num_features; i++) {
- c->features[i]->update(u, data);
- data += c->features[i]->size;
- }
-
- if (c->extra && c->extra->update)
- c->extra->update(u, ((void *) u) + c->extra_offset);
-
if (nfct_attr_is_set(ct, ATTR_STATUS))
nfct_set_attr_u32(u->ct, ATTR_STATUS,
nfct_get_attr_u32(ct, ATTR_STATUS));
@@ -281,6 +274,14 @@ static struct us_conntrack *__update(struct cache *c, struct nf_conntrack *ct)
nfct_set_attr_u32(u->ct, ATTR_TIMEOUT,
nfct_get_attr_u32(ct, ATTR_TIMEOUT));
+ for (i = 0; i < c->num_features; i++) {
+ c->features[i]->update(u, data);
+ data += c->features[i]->size;
+ }
+
+ if (c->extra && c->extra->update)
+ c->extra->update(u, ((void *) u) + c->extra_offset);
+
return u;
}
return NULL;