summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bgpd/timer.c
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2008-05-08 07:45:21 +0000
committerhenning <henning@openbsd.org>2008-05-08 07:45:21 +0000
commitce7307d24b89f48032da752274075330a73a34d5 (patch)
treeb39521efed645562a579c9045a673bb021ba7853 /usr.sbin/bgpd/timer.c
parenttake advantage of the timewheel: instead of checking each an every (diff)
downloadwireguard-openbsd-ce7307d24b89f48032da752274075330a73a34d5.tar.xz
wireguard-openbsd-ce7307d24b89f48032da752274075330a73a34d5.zip
we can stopin timer_set if new timeout equals the oldone.
matters for stuff like the HoldTimer that gets reset often
Diffstat (limited to 'usr.sbin/bgpd/timer.c')
-rw-r--r--usr.sbin/bgpd/timer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/timer.c b/usr.sbin/bgpd/timer.c
index ad07f5da073..4100ce6922f 100644
--- a/usr.sbin/bgpd/timer.c
+++ b/usr.sbin/bgpd/timer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: timer.c,v 1.7 2008/05/08 07:43:03 henning Exp $ */
+/* $OpenBSD: timer.c,v 1.8 2008/05/08 07:45:21 henning Exp $ */
/*
* Copyright (c) 2003-2007 Henning Brauer <henning@openbsd.org>
@@ -94,6 +94,8 @@ timer_set(struct peer *p, enum Timer timer, u_int offset)
fatal("timer_set");
pt->type = timer;
} else {
+ if (pt->val == time(NULL) + offset)
+ return;
TAILQ_REMOVE(&p->timers, pt, entry);
}