]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd, topotests: bmp, fix wrong peer distinguisher for vrf route events
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 31 Oct 2024 07:21:22 +0000 (08:21 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 11 Dec 2024 10:29:37 +0000 (11:29 +0100)
commitbc3a19e253d31bcb596bd190eb43513558f6ca63
treeffdc8cb5c8532ceb08efe26ca550001b83015c1e
parent96aea62fe2e84fc3ba74bf4a01305e30386f20a1
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>
bgpd/bgp_bmp.c
tests/topotests/bgp_bmp/bmp1vrf/bmp-update-post-policy-step1.json
tests/topotests/bgp_bmp/bmp1vrf/bmp-update-pre-policy-step1.json
tests/topotests/bgp_bmp/bmp1vrf/bmp-withdraw-post-policy-step1.json
tests/topotests/bgp_bmp/bmp1vrf/bmp-withdraw-pre-policy-step1.json