diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-09-19 16:15:55 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-09-19 16:15:55 +0000 |
commit | a61a902ae520e49b92f74ac38df50816399205e6 (patch) | |
tree | f58fb217393497ae99c443c6451811902575b3ad /usr.sbin/bgpd/session.h | |
parent | efa6310b5093a2046682e38f1d0b42eae1fbceb0 (diff) |
implement fast reconnects
when a peer drops to IDLE, we have to force him in IDLE for some time to
prevent fast flapping. however, the forced idle time is annoying when the
connection could be re-established immediately, i. e. bgpctl nei $peer clear
or similar.
implement an error counter per peer, increased every time we receive a
notification. when we are in state IDLE and get a connection from the peer
in question, check if the error counter is 1 or smaller. if so, change state
to active and accept the connection, otherwise keep the current behaviour
and reject the connection.
the error counter gets scaled back by the IdleHoldResetTimer that scales the
IdleHoldTime back as well
Diffstat (limited to 'usr.sbin/bgpd/session.h')
-rw-r--r-- | usr.sbin/bgpd/session.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index 950aeb425ea..7f613364c72 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.77 2005/06/04 22:50:20 henning Exp $ */ +/* $OpenBSD: session.h,v 1.78 2005/09/19 16:15:54 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -168,6 +168,7 @@ struct peer { time_t IdleHoldResetTimer; int fd; int lasterr; + u_int errcnt; u_int IdleHoldTime; u_int32_t remote_bgpid; enum session_state state; @@ -175,6 +176,7 @@ struct peer { u_int16_t holdtime; u_int8_t auth_established; u_int8_t depend_ok; + u_int8_t passive; }; struct peer *peers; |