diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2010-06-14 08:10:33 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2010-06-14 08:10:33 +0000 |
commit | e834fcd4ecac4135ad6e8ed7ea7be646efaea5cd (patch) | |
tree | b1e904ba3cd6d6a0811d72756affe0b53d9562fb /sbin/iked/timer.c | |
parent | e1944808d62d45bb05963968faa0fde7ab36feed (diff) |
More code for initiator mode (not finished yet)
Diffstat (limited to 'sbin/iked/timer.c')
-rw-r--r-- | sbin/iked/timer.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sbin/iked/timer.c b/sbin/iked/timer.c index 44a5ce7a9ec..2664ed41251 100644 --- a/sbin/iked/timer.c +++ b/sbin/iked/timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timer.c,v 1.1 2010/06/11 12:47:18 reyk Exp $ */ +/* $OpenBSD: timer.c,v 1.2 2010/06/14 08:10:32 reyk Exp $ */ /* * Copyright (c) 2010 Reyk Floeter <reyk@vantronix.net> @@ -39,7 +39,7 @@ struct timer_cbarg { struct timeval tmr_first; struct timeval tmr_last; struct timeval tmr_tv; - void (*tmr_initcb)(struct iked *, struct iked_policy *); + int (*tmr_initcb)(struct iked *, struct iked_policy *); } timer_initiator; void timer_initiator_cb(int, short, void *); @@ -49,7 +49,7 @@ void timer_initiator_cb(int, short, void *); void timer_register_initiator(struct iked *env, - void (*cb)(struct iked *, struct iked_policy *)) + int (*cb)(struct iked *, struct iked_policy *)) { struct timer_cbarg *tmr; @@ -102,8 +102,10 @@ timer_initiator_cb(int fd, short event, void *arg) log_debug("%s: initiating \"%s\"", __func__, pol->pol_name); - if (tmr->tmr_initcb != NULL) - tmr->tmr_initcb(env, pol); + if (tmr->tmr_initcb != NULL) { + /* Ignore error but what should we do on failure? */ + (void)tmr->tmr_initcb(env, pol); + } } tmr->tmr_tv.tv_sec = IKED_TIMER_INITIATOR_INTERVAL; |