summaryrefslogtreecommitdiffstats
path: root/src/alarm.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/alarm.c
parent96213d5f0821aee2fe52459ab2cd54569e50cf85 (diff)
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/alarm.c')
-rw-r--r--src/alarm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/alarm.c b/src/alarm.c
index 91ee2ca..fe938a0 100644
--- a/src/alarm.c
+++ b/src/alarm.c
@@ -123,7 +123,7 @@ do_alarm_run(struct timeval *next_run)
{
struct list_head alarm_run_queue;
struct rb_node *node;
- struct alarm_block *this;
+ struct alarm_block *this, *tmp;
struct timeval tv;
gettimeofday(&tv, NULL);
@@ -138,7 +138,8 @@ do_alarm_run(struct timeval *next_run)
list_add(&this->list, &alarm_run_queue);
}
- list_for_each_entry(this, &alarm_run_queue, list) {
+ /* must be safe as entries can vanish from the callback */
+ list_for_each_entry_safe(this, tmp, &alarm_run_queue, list) {
rb_erase(&this->node, &alarm_root);
RB_CLEAR_NODE(&this->node);
this->function(this, this->data);