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-14 15:22:24 +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-14 15:22:24 +0000
commit6e5b6c91625fd431ac3d1339f55a4aa278ff2604 (patch)
tree79e087eebf878ff86bc4dd74292c97748f593b15 /src/sync-alarm.c
parent94aa8b70f2e8cf7cf664d7c0e86a9ebc287010ef (diff)
downloadconntrack-tools-6e5b6c91625fd431ac3d1339f55a4aa278ff2604.tar.gz
conntrack-tools-6e5b6c91625fd431ac3d1339f55a4aa278ff2604.zip
improve alarm framework based on suggestions from Max Duempel
Diffstat (limited to 'src/sync-alarm.c')
-rw-r--r--src/sync-alarm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sync-alarm.c b/src/sync-alarm.c
index 632eff2..3d20867 100644
--- a/src/sync-alarm.c
+++ b/src/sync-alarm.c
@@ -31,8 +31,9 @@ static void refresher(struct alarm_list *a, void *data)
debug_ct(u->ct, "persistence update");
init_alarm(a);
- set_alarm_expiration_secs(a, random() % CONFIG(refresh) + 1);
- set_alarm_expiration_usecs(a, random() % 999999 + 1);
+ set_alarm_expiration(a,
+ random() % CONFIG(refresh) + 1,
+ random() % 999999 + 1);
set_alarm_data(a, u);
set_alarm_function(a, refresher);
@@ -48,8 +49,9 @@ static void cache_alarm_add(struct us_conntrack *u, void *data)
struct alarm_list *alarm = data;
init_alarm(alarm);
- set_alarm_expiration_secs(alarm, random() % CONFIG(refresh) + 1);
- set_alarm_expiration_usecs(alarm, random() % 999999 + 1);
+ set_alarm_expiration(alarm,
+ random() % CONFIG(refresh) + 1,
+ random() % 999999 + 1);
set_alarm_data(alarm, u);
set_alarm_function(alarm, refresher);
add_alarm(alarm);