]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: send correct BMP down message when nht fails 8067/head
authorQuentin Young <qlyoung@qlyoung.net>
Thu, 11 Feb 2021 23:54:27 +0000 (18:54 -0500)
committerQuentin Young <qlyoung@nvidia.com>
Fri, 12 Feb 2021 19:11:05 +0000 (14:11 -0500)
commit21e8caa2935e1ee29b24b8d8b110ca0d4196cecf
tree8b0de62a2d4eadf87138f21b8fc1d4aa99a3e49c
parent497bb82b623579ade9fb54b7a32d0e8f7f3b4c74
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