summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2019-08-12 14:15:28 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2019-08-12 14:15:28 +0000
commitd2cae16107c7f230139f8e8bc602bb0b078ca29e (patch)
tree26e733489d1a953f49eca9a5f33331a6bc95e811 /usr.sbin
parenta20b3c9762e97aea537f79fa83935509b87398bc (diff)
Change the way IdleHoldTime is reset once the session is up and stable.
The implemented reverse exponential backoff results in very long times until a session gets back to the initial hold values. Instead just wait for the timer to fire once and reset the settings then. In most cases the timer is double the IdleHold time (because of the way the backoff is implemented) which is enough to ensure that fast flapping sessions are punished. OK benno@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/session.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index c974c452742..42008c85f53 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.388 2019/07/24 20:25:27 benno Exp $ */
+/* $OpenBSD: session.c,v 1.389 2019/08/12 14:15:27 claudio Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -385,18 +385,10 @@ session_main(int debug, int verbose)
bgp_fsm(p, EVNT_START);
break;
case Timer_IdleHoldReset:
- p->IdleHoldTime /= 2;
- if (p->IdleHoldTime <=
- INTERVAL_IDLE_HOLD_INITIAL) {
- p->IdleHoldTime =
- INTERVAL_IDLE_HOLD_INITIAL;
- timer_stop(p,
- Timer_IdleHoldReset);
- p->errcnt = 0;
- } else
- timer_set(p,
- Timer_IdleHoldReset,
- p->IdleHoldTime);
+ p->IdleHoldTime =
+ INTERVAL_IDLE_HOLD_INITIAL;
+ p->errcnt = 0;
+ timer_stop(p, Timer_IdleHoldReset);
break;
case Timer_CarpUndemote:
timer_stop(p, Timer_CarpUndemote);