diff options
author | Vitaliy Senchyshyn <vsenchyshyn@toroki.com> | 2013-10-02 10:40:20 +0000 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2014-05-15 19:54:04 +0200 |
commit | 6aa136f1eaeb0dfc1e39e6c2cd6380a399ef126f (patch) | |
tree | b1313a9961fe29a4ccf91571a5c772545351084d /bgpd/bgpd.h | |
parent | b366b518401e0b0652cd70d297d3fb67b4803db0 (diff) | |
download | quagga-6aa136f1eaeb0dfc1e39e6c2cd6380a399ef126f.tar.bz2 quagga-6aa136f1eaeb0dfc1e39e6c2cd6380a399ef126f.tar.xz |
bgpd: send notify in OpenSent when stopping manually
The issue it fixes is that the notification message is not sent to a
second peer when bgp is stopped manually.
According to BGP RFC4271, section 8.2.2, regarding the FSM transitions,
in OpenSent state:
If a ManualStop event (Event 2) is issued in the OpenSent state, the
local system:
* sends the NOTIFICATION with a Cease,
* sets the ConnectRetryTimer to zero,
* releases all BGP resources,
* drops the TCP connection,
* sets the ConnectRetryCounter to zero, and
* changes its state to Idle.
I've added a check for OpenSent state when the notification is sent from
the functions which are called from the CLI commands which
directly/indirectly stop/restart BGP.
Acked-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgpd.h')
-rw-r--r-- | bgpd/bgpd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 024fedcf..3d516d35 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -778,6 +778,8 @@ enum bgp_clear_type /* Macros. */ #define BGP_INPUT(P) ((P)->ibuf) #define BGP_INPUT_PNT(P) (STREAM_PNT(BGP_INPUT(P))) +#define BGP_IS_VALID_STATE_FOR_NOTIF(S)\ + (((S) == OpenSent) || ((S) == OpenConfirm) || ((S) == Established)) /* Count prefix size from mask length */ #define PSIZE(a) (((a) + 7) / (8)) |