]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: send correct BMP down message when nht fails
authorQuentin Young <qlyoung@qlyoung.net>
Thu, 11 Feb 2021 23:54:27 +0000 (18:54 -0500)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 16 Feb 2021 18:11:37 +0000 (21:11 +0300)
commit7fa78b659f8e720466e0df62689327ea4b9ff867
tree8be126f5bcffbc1890036dd95da649577d4e5107
parent385faf6c079a41def1e6eb882cbfd50047559644
bgpd: send correct BMP down message when nht fails

When sending BMP messages for a status change event for a peer whose NHT
has failed, we were sending a Peer Down Reason Code of 1 (Local system
closed, NOTIFICATION follows) with no NOTIFICAION PDU (because there was
none). This is wrong. Also, the reason code of 1 is semantically off, it
should be 2 (Local system closed, FSM event follows).

This patch:

- adds definitions of all BGP FSM event codes per RFC4271
- changes the BMP reason code emitted when a peer changes state due to
  NHT failure to 2 and encodes FSM event 18 (TcpConnectionFails)
- changes the catch-all case where we have not yet
  implemented the appropriate BMP response to indicate reason code 2
  with FSM event 0 (no relevant Event code is defined).

These changes ought to prevent the BMP session from being torn down due
to an improperly formatted message.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
bgpd/bgp_bmp.c
bgpd/bgp_bmp.h
bgpd/bgpd.h