]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd, topotests: bmp, fix wrong peer type for vrf route messages
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 31 Oct 2024 08:18:56 +0000 (09:18 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 11 Dec 2024 10:29:37 +0000 (11:29 +0100)
commit96aea62fe2e84fc3ba74bf4a01305e30386f20a1
tree287940a386a5b7aa6ccff49a6a9a52ae751a3c3f
parent3c68228a05d158072bad2679d3fb4ad2bac8f35a
bgpd, topotests: bmp, fix wrong peer type for vrf route messages

When running the bgp_bmp_2 vrf test, peer route messages 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-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}

In addition to global instance peers, RFC7854 defines RD instance peers.
This value can be used for peers which are on a BGP VRF instance, for
example with an L3VPN setup.

When configuring a BGP VRF instance, the peer type should be seen as an
RD instance peer.

Fix this by modifying the BMP client:
- update the peer type for vrf mirror and monitoring messages
- modify bgp_bmp_2 vrf test to control the peer_type 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}

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