]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Fix missing case for decoding link-local next hops in VPN SAFI
authorOndrej Zajicek <santiago@crfreenet.org>
Mon, 24 Mar 2025 16:03:41 +0000 (17:03 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 24 Mar 2025 16:03:41 +0000 (17:03 +0100)
proto/bgp/packets.c

index bfb8c672e8d44b296d829112ce0ce4215564d8a9..4ee7c5a5f8f507565dceb78a1a059cdaea97281a 100644 (file)
@@ -1448,6 +1448,9 @@ bgp_decode_next_hop_vpn(struct bgp_parse_state *s, byte *data, uint len, rta *a)
     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;
   }