]> git.puffer.fish Git - mirror/frr.git/commit
bgpd, topotests: bmp, fix wrong peer type for peer up/down events
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 31 Oct 2024 08:31:04 +0000 (09:31 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 11 Dec 2024 10:47:56 +0000 (11:47 +0100)
commit188ba91082956b14633e9857a36f7481b6082e66
tree9c5db5ab1b4720a629b50b5caa434fefd0cb4a77
parentbc3a19e253d31bcb596bd190eb43513558f6ca63
bgpd, topotests: bmp, fix wrong peer type for peer up/down events

When running the bgp_bmp_2 vrf test, peer up/down events from the pre
and post policy are received with a wrong peer type value

> {"peer_type": "global instance", "policy": "pre-policy", "ipv6": false,
> "peer_ip": "192.168.0.2", "peer_distinguisher": "0:0", "peer_asn": 65502,
> "peer_bgp_id": "192.168.0.2", "timestamp": "2024-10-16 21:59:53.111962",
> "bmp_log_type": "peer up", "local_ip": "192.168.0.1", "local_port": 179,
> "remote_port": 50710, "seq": 4}

RFC7854 defines RD instance peer type, and later in 4.2 requests that
the peer distinguisher value be set to non zero value when the peer type
is not global. This is the case for peer vrf instances.

Fix this by modifying the BMP client, update the peer type
value by updating the peer type value when sending peer up/down messages.

Add a check in the bgp_bmp_2 test to ensure that peer type is correctly
set.

> {"peer_type": "route distinguisher instance", "policy": "pre-policy",
> "ipv6": true, "peer_ip": "192:168::2", "peer_distinguisher": "0:0",
> "peer_asn": 65502, "peer_bgp_id": "192.168.0.2", "timestamp":
> "2024-10-16 21:59:53.111962", "bmp_log_type": "peer up", "local_ip":
> "192:168::1", "local_port": 179, "remote_port": 50836, "seq": 5}

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_bmp.c
tests/topotests/bgp_bmp/bgpbmp.py
tests/topotests/bgp_bmp/test_bgp_bmp_2.py