From: Philippe Guibert Date: Mon, 23 Jan 2023 15:27:45 +0000 (+0100) Subject: bgpd: encode properly vpnv6 nexthop X-Git-Tag: base_8.5~41^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=f7a0eb6a1736e85b5991ffc919805b812a6d7576;p=matthieu%2Ffrr.git bgpd: encode properly vpnv6 nexthop This change updates the nexthop attribute length accordingly to the safi used. Actually, with the previous commit, the length calculated was not aligned with the real nexthop length. Such packet received by remote peer was malformed, and this was resulting in breaking vpnv6 peering. Fix this by updating appropriately the real nexthop length. Fixes: 35ac9b53f2e2 ("bgpd: fix vpnv6 nexthop encoding") Signed-off-by: Philippe Guibert --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 59d8544953..3f07e53bb6 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2273,8 +2273,12 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi, && peer->shared_network && (from == bgp->peer_self || peer->sort == BGP_PEER_EBGP))) { - attr->mp_nexthop_len = - BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL; + if (safi == SAFI_MPLS_VPN) + attr->mp_nexthop_len = + BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL; + else + attr->mp_nexthop_len = + BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL; } /* Clear off link-local nexthop in source, whenever it is not