summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2009-01-21 20:32:54 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2009-01-21 20:32:54 +0000
commit22e4957d7c02f48587b9aca5c791af9518d129fe (patch)
tree7a092b1ce95ab19643cec2e610fc3d372a96ce27
parent5812fe749eb032c3170abc1df9302200d8d4b806 (diff)
timer_nextduein returned crap. fix it. so obvious... how could that happen.
found out the hard way by Marc Runkel <MRunkel@untangle.com>
-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 8b30fae7adf..41ccede8d54 100644
--- a/usr.sbin/bgpd/timer.c
+++ b/usr.sbin/bgpd/timer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: timer.c,v 1.12 2008/06/11 05:30:35 henning Exp $ */
+/* $OpenBSD: timer.c,v 1.13 2009/01/21 20:32:53 henning Exp $ */
/*
* Copyright (c) 2003-2007 Henning Brauer <henning@openbsd.org>
@@ -65,7 +65,7 @@ timer_nextduein(struct peer *p)
struct peer_timer *pt;
if ((pt = TAILQ_FIRST(&p->timers)) != NULL && pt->val > 0)
- return (pt->val);
+ return (MAX(pt->val - getmonotime(), 0));
return (-1);
}