diff options
author | Chris Hall <GMCH@hestia.halldom.com> | 2010-08-04 11:20:31 +0100 |
---|---|---|
committer | Chris Hall <GMCH@hestia.halldom.com> | 2010-08-04 11:20:31 +0100 |
commit | 11fe7d1d77cfd7b29ea14cc05b7fb2ea6ba13b74 (patch) | |
tree | 09b66e2a01eac2c3a8f610fed5bec9fbb062abfb /bgpd/bgp_fsm.c | |
parent | 4af8f7adc4fe05de92cb11912af029c623feb821 (diff) | |
download | quagga-11fe7d1d77cfd7b29ea14cc05b7fb2ea6ba13b74.tar.bz2 quagga-11fe7d1d77cfd7b29ea14cc05b7fb2ea6ba13b74.tar.xz |
Fix various capability flags so that sessions are restarted.
For some reason (unknown) changing the following did NOT restart any
active session:
neighbor dont-capability-negotiate
neighbor override-capability
neighbor strict-capability-match
since these can all change the nature of a session, this seems to be
a (long time) bug, and has been fixed.
Also, per RFC 5492: if (during OpenSent and OpenConfirm) get a
NOTIFICATION: "Open/Unsupported Optional Parameter", treat that as
"don't understand capabilities" and suppress sending of capabilities.
Advanced to "ex05".
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r-- | bgpd/bgp_fsm.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 9df8a955..b1c085bd 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1945,12 +1945,28 @@ static bgp_fsm_action(bgp_fsm_error) * * Next state will be sIdle, except if is sEstablished, when will be sStopping. * - * NB: requires the session LOCKED + * Per RFC 5492: if get a NOTIFICATION: "Open/Unsupported Optional Parameter" + * then suppress sending of capabilities. + * + * If didn't send capabilities the last time, doesn't make any + * difference if suppress them from now on ! * - * TODO: deal with: BGP_NOMC_OPEN/BGP_NOMS_O_OPTION & squash capabilities. + * NB: requires the session LOCKED */ static bgp_fsm_action(bgp_fsm_recv_nom) { + if (connection->state != bgp_fsm_sEstablished) + { + if ( (connection->notification->code == BGP_NOMC_OPEN) + && (connection->notification->subcode == BGP_NOMS_O_OPTION) ) + { + if (!connection->cap_suppress) + BGP_FSM_DEBUG(connection, "Suppressing Capabilities") ; + + connection->cap_suppress = true ; + } ; + } ; + return bgp_fsm_catch(connection, next_state) ; } ; |