]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgp_zebra.c
bgpd: ignore NEXT_HOP for MP_REACH_NLRI
authorTrey Aspelund <taspelund@nvidia.com>
Tue, 26 Jul 2022 22:04:14 +0000 (22:04 +0000)
committerTrey Aspelund <taspelund@nvidia.com>
Thu, 4 Aug 2022 20:36:49 +0000 (20:36 +0000)
commit7226bc40d606e30251024032995ff21c391ad19f
tree375eda5248ac1ca7cfc2344c1c67f3051ffebfae
parent109153dde80ff0afde942fca4e23c9df6d2fc803
bgpd: ignore NEXT_HOP for MP_REACH_NLRI

RFC 4760 states we SHOULD ignore the NEXT_HOP attribute for BGP Update
messages carrying only MP_REACH_NLRI attributes. Thus we should use the
Network Address of Next Hop field of the MP_REACH_NLRI as the nexthop.

Instead of always looking for BGP_ATTR_NEXT_HOP, this commit ensures:
1) we set mp_nexthop_len to BGP_ATTR_NHLEN_IPV4 for v4 bgp_static routes
2) we check mp_nexthop_len when choosing the nexthop to use for nht
3) we check mp_nexthop_len when choosing the nexthop to send to zebra
4) we check mp_nexthop_len when picking the nexthop to shown by vtysh

Reported-by: Binon Gorbutt <binon@aervivo.com>
Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
bgpd/bgp_evpn.c
bgpd/bgp_nht.c
bgpd/bgp_route.c
bgpd/bgp_zebra.c