summaryrefslogtreecommitdiff
path: root/src/sync-ftfw.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>2008-04-29 14:18:17 +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>2008-04-29 14:18:17 +0000
commitace1f6a61b6842e2b49ec7a08f368a2d9f433be0 (patch)
tree92c62e1bf75ff98d949b8f71a0f79c948d1e544a /src/sync-ftfw.c
parent96213d5f0821aee2fe52459ab2cd54569e50cf85 (diff)
downloadconntrack-tools-ace1f6a61b6842e2b49ec7a08f368a2d9f433be0.tar.gz
conntrack-tools-ace1f6a61b6842e2b49ec7a08f368a2d9f433be0.zip
Fix reorder possible reordering of destroy messages under message omission. This patch introduces the TimeoutDestroy clause to determine how long a conntrack remains in the internal cache once it has been destroy from the kernel table.
Diffstat (limited to 'src/sync-ftfw.c')
-rw-r--r--src/sync-ftfw.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/sync-ftfw.c b/src/sync-ftfw.c
index 0b98513..77f8fd4 100644
--- a/src/sync-ftfw.c
+++ b/src/sync-ftfw.c
@@ -390,6 +390,7 @@ static void ftfw_send(struct nethdr *net, struct us_conntrack *u)
switch(ntohs(pld->query)) {
case NFCT_Q_CREATE:
case NFCT_Q_UPDATE:
+ case NFCT_Q_DESTROY:
cn = (struct cache_ftfw *)
cache_get_extra(STATE_SYNC(internal), u);
@@ -402,9 +403,6 @@ static void ftfw_send(struct nethdr *net, struct us_conntrack *u)
list_add_tail(&cn->rs_list, &rs_list);
rs_list_len++;
break;
- case NFCT_Q_DESTROY:
- queue_add(rs_queue, net, net->len);
- break;
}
}
@@ -429,10 +427,10 @@ static int tx_queue_xmit(void *data1, const void *data2)
return 0;
}
-static int tx_list_xmit(struct list_head *i, struct us_conntrack *u)
+static int tx_list_xmit(struct list_head *i, struct us_conntrack *u, int type)
{
int ret;
- struct nethdr *net = BUILD_NETMSG(u->ct, NFCT_Q_UPDATE);
+ struct nethdr *net = BUILD_NETMSG(u->ct, type);
size_t len = prepare_send_netmsg(STATE_SYNC(mcast_client), net);
dp("tx_list sq: %u fl:%u len:%u\n",
@@ -460,7 +458,10 @@ static void ftfw_run(void)
struct us_conntrack *u;
u = cache_get_conntrack(STATE_SYNC(internal), cn);
- tx_list_xmit(&cn->tx_list, u);
+ if (alarm_pending(&u->alarm))
+ tx_list_xmit(&cn->tx_list, u, NFCT_Q_DESTROY);
+ else
+ tx_list_xmit(&cn->tx_list, u, NFCT_Q_UPDATE);
}
/* reset alive alarm */