diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-09-16 17:44:37 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-09-16 17:44:37 +0000 |
commit | efa48c743d42e62992290a70cac6934c7ff421b1 (patch) | |
tree | d233a4d47a1c4d63751679a44d00b2eb81e007ee /usr.sbin/bgpd/session.c | |
parent | ecba5c786e44e6efc1fcc79d17327c21aa4b1c8d (diff) |
when a cloned peer goes back to IDLE state, don't remove him immediately
but keep him around for some more time (an hour here).
fixes an issue Arvid was reporting: when a cloned neighbor rejects our OPEN
message due to capability negotiation (or missing implementation of those),
we set a marker and retry without. However, if we remove the peer immediately,
it gets freshly cloned on the next trial, with default settings, thus including
capability negotiation, and thus failes again.
this will also help with route flap dampening.
ok claudio
Diffstat (limited to 'usr.sbin/bgpd/session.c')
-rw-r--r-- | usr.sbin/bgpd/session.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 15cf0e7d94e..ba6fe7d2865 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.191 2004/09/16 17:36:29 henning Exp $ */ +/* $OpenBSD: session.c,v 1.192 2004/09/16 17:44:36 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -264,6 +264,12 @@ session_main(struct bgpd_config *config, struct peer *cpeers, for (p = peers; p != NULL; p = next) { next = p->next; if (!pending_reconf) { + /* cloned peer that idled out? */ + if (p->state == STATE_IDLE && p->conf.cloned && + time(NULL) - p->stats.last_updown >= + INTERVAL_HOLD_CLONED) + p->conf.reconf_action = RECONF_DELETE; + /* new peer that needs init? */ if (p->state == STATE_NONE) init_peer(p); @@ -838,14 +844,12 @@ change_state(struct peer *peer, enum session_state state, peer->rbuf = NULL; if (peer->state == STATE_ESTABLISHED) session_down(peer); - if (event != EVNT_STOP && !peer->conf.cloned) { + if (event != EVNT_STOP) { peer->IdleHoldTimer = time(NULL) + peer->IdleHoldTime; if (event != EVNT_NONE && peer->IdleHoldTime < MAX_IDLE_HOLD/2) peer->IdleHoldTime *= 2; } - if (peer->state != STATE_NONE && peer->conf.cloned) - peer->conf.reconf_action = RECONF_DELETE; break; case STATE_CONNECT: break; |