From 13fba73cec6be16d64c86e03a04dc4a8a26d46f6 Mon Sep 17 00:00:00 2001 From: henning Date: Wed, 21 Jan 2009 20:32:53 +0000 Subject: [PATCH] timer_nextduein returned crap. fix it. so obvious... how could that happen. found out the hard way by Marc Runkel --- usr.sbin/bgpd/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bgpd/timer.c b/usr.sbin/bgpd/timer.c index 8b30fae7adf9..41ccede8d54a 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 @@ -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); }