summaryrefslogtreecommitdiff
path: root/src/sync-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-01-20 23:51:23 +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-01-20 23:51:23 +0000
commitbcae271764d18e570a5fca382eeea748add4af62 (patch)
tree27dd1b721b8635145aafe17dbec7cc83d25a4cf1 /src/sync-alarm.c
parent00ad2e9e1c6cf9e14c76660f2b748247c1f4bd83 (diff)
downloadconntrack-tools-bcae271764d18e570a5fca382eeea748add4af62.tar.gz
conntrack-tools-bcae271764d18e570a5fca382eeea748add4af62.zip
Based on patch from Max Kellermann <max@duempel.org>:
merge mod_alarm() into add_alarm(), remove alarm_set_expiration()
Diffstat (limited to 'src/sync-alarm.c')
-rw-r--r--src/sync-alarm.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/sync-alarm.c b/src/sync-alarm.c
index 9ab9d96..1f164b2 100644
--- a/src/sync-alarm.c
+++ b/src/sync-alarm.c
@@ -36,11 +36,9 @@ static void refresher(struct alarm_list *a, void *data)
debug_ct(u->ct, "persistence update");
init_alarm(a, u, refresher);
- set_alarm_expiration(a,
- random() % CONFIG(refresh) + 1,
- ((random() % 5 + 1) * 200000) - 1);
-
- add_alarm(a);
+ add_alarm(a,
+ random() % CONFIG(refresh) + 1,
+ ((random() % 5 + 1) * 200000) - 1);
net = BUILD_NETMSG(u->ct, NFCT_Q_UPDATE);
len = prepare_send_netmsg(STATE_SYNC(mcast_client), net);
@@ -52,16 +50,15 @@ static void cache_alarm_add(struct us_conntrack *u, void *data)
struct alarm_list *alarm = data;
init_alarm(alarm, u, refresher);
- set_alarm_expiration(alarm,
- random() % CONFIG(refresh) + 1,
- ((random() % 5 + 1) * 200000) - 1);
- add_alarm(alarm);
+ add_alarm(alarm,
+ random() % CONFIG(refresh) + 1,
+ ((random() % 5 + 1) * 200000) - 1);
}
static void cache_alarm_update(struct us_conntrack *u, void *data)
{
struct alarm_list *alarm = data;
- mod_alarm(alarm, random() % CONFIG(refresh) + 1, random() % 999999 + 1);
+ add_alarm(alarm, random() % CONFIG(refresh) + 1, random() % 999999 + 1);
}
static void cache_alarm_destroy(struct us_conntrack *u, void *data)