mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 17:18:56 +00:00
bgpd: fix peer up message for loc-rib not sent
At startup, there is no peer up message for loc-rib instance peer.
Instead, a global peer up message with address 0.0.0.0 is sent.
Such message is wrong, violates the RFC and should be dropped by
a strict collector. Actually, the peer type message sent is wrong,
and should be set to LOC-RIB peer type.
Fix this by changing the peer type of peer up message to either
loc-rib or global instance peer type.
Fixes: 035304c25a
("bgpd: bmp loc-rib peer up/down for vrfs")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
34485ee536
commit
013b9d4c19
@ -467,13 +467,19 @@ static struct stream *bmp_peerstate(struct peer *peer, bool down)
|
|||||||
struct stream *s;
|
struct stream *s;
|
||||||
size_t len;
|
size_t len;
|
||||||
struct timeval uptime, uptime_real;
|
struct timeval uptime, uptime_real;
|
||||||
|
uint8_t peer_type;
|
||||||
|
bool is_locrib = false;
|
||||||
|
|
||||||
uptime.tv_sec = peer->uptime;
|
uptime.tv_sec = peer->uptime;
|
||||||
uptime.tv_usec = 0;
|
uptime.tv_usec = 0;
|
||||||
monotime_to_realtime(&uptime, &uptime_real);
|
monotime_to_realtime(&uptime, &uptime_real);
|
||||||
|
|
||||||
uint8_t peer_type = bmp_get_peer_type(peer);
|
peer_type = bmp_get_peer_type(peer);
|
||||||
bool is_locrib = peer_type == BMP_PEER_TYPE_LOC_RIB_INSTANCE;
|
if (peer_type == BMP_PEER_TYPE_LOC_RIB_INSTANCE)
|
||||||
|
is_locrib = true;
|
||||||
|
else
|
||||||
|
/* TODO: remove this when other RD and local instances supported */
|
||||||
|
peer_type = BMP_PEER_TYPE_GLOBAL_INSTANCE;
|
||||||
|
|
||||||
#define BGP_BMP_MAX_PACKET_SIZE 1024
|
#define BGP_BMP_MAX_PACKET_SIZE 1024
|
||||||
#define BMP_PEERUP_INFO_TYPE_STRING 0
|
#define BMP_PEERUP_INFO_TYPE_STRING 0
|
||||||
@ -484,9 +490,7 @@ static struct stream *bmp_peerstate(struct peer *peer, bool down)
|
|||||||
|
|
||||||
bmp_common_hdr(s, BMP_VERSION_3,
|
bmp_common_hdr(s, BMP_VERSION_3,
|
||||||
BMP_TYPE_PEER_UP_NOTIFICATION);
|
BMP_TYPE_PEER_UP_NOTIFICATION);
|
||||||
bmp_per_peer_hdr(s, peer->bgp, peer, 0,
|
bmp_per_peer_hdr(s, peer->bgp, peer, 0, peer_type, 0, &uptime_real);
|
||||||
BMP_PEER_TYPE_GLOBAL_INSTANCE, 0,
|
|
||||||
&uptime_real);
|
|
||||||
|
|
||||||
/* Local Address (16 bytes) */
|
/* Local Address (16 bytes) */
|
||||||
if (is_locrib)
|
if (is_locrib)
|
||||||
|
Loading…
Reference in New Issue
Block a user