mirror_frr/tests/topotests/bgp_bmp/bmp1vrf
Philippe Guibert bc3a19e253 bgpd, topotests: bmp, fix wrong peer distinguisher for vrf route events
When running the bgp_bmp_2 vrf test, peer route messages from the pre
and post policy are received with a wrong peer distinguisher value.

> {"peer_type": "route distinguisher 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-31 08:19:58.111963",
> "bmp_log_type": "update", "origin": "IGP", "as_path": "65501 65502",
> "bgp_nexthop": "192.168.0.2", "ip_prefix": "172.31.0.15/32", "seq": 15}

RFC7854 mentions in 4.2 that if the peer is a "RD Instance Peer", it is
set to the route distinguisher of the particular instance the peer
belongs to.

Fix this by modifying the BMP client:
- update the peer distinguisher value by unlocking the filling of the peer distinguisher in the function.
This change impacts monitoring messages.
- add the peer distinguisher computation for mirror messages
- modify the bgp_bmp_2 vrf test, update the peer_distinguisher value

> {"peer_type": "route distinguisher instance", "policy": "pre-policy", "ipv6": false,
> "peer_ip": "192.168.0.2", "peer_distinguisher": "444:1", "peer_asn": 65502,
> "peer_bgp_id": "192.168.0.2", "timestamp": "2024-10-31 08:19:58.111963",
> "bmp_log_type": "update", "origin": "IGP", "as_path": "65501 65502",
> "bgp_nexthop": "192.168.0.2", "ip_prefix": "172.31.0.15/32", "seq": 15}

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-11 11:29:37 +01:00
..
bmp-update-loc-rib-step1.json topotests: bgp_bmp, expose peer_distinguisher in loc-rib 2024-12-11 11:29:37 +01:00
bmp-update-post-policy-step1.json bgpd, topotests: bmp, fix wrong peer distinguisher for vrf route events 2024-12-11 11:29:37 +01:00
bmp-update-pre-policy-step1.json bgpd, topotests: bmp, fix wrong peer distinguisher for vrf route events 2024-12-11 11:29:37 +01:00
bmp-withdraw-loc-rib-step1.json topotests: bgp_bmp, expose peer_distinguisher in loc-rib 2024-12-11 11:29:37 +01:00
bmp-withdraw-post-policy-step1.json bgpd, topotests: bmp, fix wrong peer distinguisher for vrf route events 2024-12-11 11:29:37 +01:00
bmp-withdraw-pre-policy-step1.json bgpd, topotests: bmp, fix wrong peer distinguisher for vrf route events 2024-12-11 11:29:37 +01:00