From 35f4ada0856061cb60f216282934c71264c2525f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 24 Mar 2025 17:03:41 +0100 Subject: [PATCH] BGP: Fix missing case for decoding link-local next hops in VPN SAFI --- proto/bgp/packets.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index a40ca91b4..eeee3b4f3 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -1487,6 +1487,9 @@ bgp_decode_next_hop_vpn(struct bgp_parse_state *s, byte *data, uint len, ea_list nh[0] = ipa_from_ip6(get_ip6(data+8)); nh[1] = ipa_from_ip6(get_ip6(data+32)); + if (ipa_is_link_local(nh[0])) + { nh[1] = nh[0]; nh[0] = IPA_NONE; } + if (ipa_is_ip4(nh[0]) || !ip6_is_link_local(nh[1])) nh[1] = IPA_NONE; } -- 2.47.2