summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bgpd/timer.c
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2008-05-08 07:40:03 +0000
committerhenning <henning@openbsd.org>2008-05-08 07:40:03 +0000
commit2ad73ffe79b0e37c6ad22700b90897884393ddff (patch)
tree61c3da13273f40a8ac480c5358f38293b2338944 /usr.sbin/bgpd/timer.c
parentLoosen grammer to permit any number of newlines within most kinds of { } (diff)
downloadwireguard-openbsd-2ad73ffe79b0e37c6ad22700b90897884393ddff.tar.xz
wireguard-openbsd-2ad73ffe79b0e37c6ad22700b90897884393ddff.zip
in timer_set, when figuring out the right position for the timer,
wemust stop walking the list once werun into a stopped timer, or eventually all stopped timers will queue up at the very front (instead of at the tail)
Diffstat (limited to 'usr.sbin/bgpd/timer.c')
-rw-r--r--usr.sbin/bgpd/timer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/timer.c b/usr.sbin/bgpd/timer.c
index 74093c62864..b2dce26e63a 100644
--- a/usr.sbin/bgpd/timer.c
+++ b/usr.sbin/bgpd/timer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: timer.c,v 1.5 2008/05/08 06:52:13 henning Exp $ */
+/* $OpenBSD: timer.c,v 1.6 2008/05/08 07:40:03 henning Exp $ */
/*
* Copyright (c) 2003-2007 Henning Brauer <henning@openbsd.org>
@@ -88,7 +88,7 @@ timer_set(struct peer *p, enum Timer timer, u_int offset)
pt->val = time(NULL) + offset;
TAILQ_FOREACH(t, &p->timers, entry)
- if (t->val > pt->val)
+ if (t->val == 0 || t->val > pt->val)
break;
if (t != NULL)
TAILQ_INSERT_BEFORE(t, pt, entry);