]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Stop overriding nexthop when BGP unnumberred
authorRyoga Saito <ryoga.saito@linecorp.com>
Sun, 4 Dec 2022 14:51:45 +0000 (23:51 +0900)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Mon, 19 Dec 2022 21:29:48 +0000 (21:29 +0000)
When we use vrf-to-vrf export, the nexthop has already not been
overridden when the peer is BGP unnumberred. However, when we use normal
export, the nexthop will be oberridden. This behavior will make the VPN
routes invalid in VPN RIB.

This PR stops overriding nexthop even if we use normal export.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
(cherry picked from commit f784007d677ee20e4dbd20366928652be2a0b23c)

bgpd/bgp_mplsvpn.c

index d7fd4bc77e0c818925d00907275d93fbd6b821a5..fa9ea46e7ee52ecc22cf04e1169d23c164c86fc4 100644 (file)
@@ -1195,7 +1195,8 @@ void vpn_leak_from_vrf_update(struct bgp *to_bgp,      /* to */
        } else {
                if (!CHECK_FLAG(from_bgp->af_flags[afi][SAFI_UNICAST],
                                BGP_CONFIG_VRF_TO_VRF_EXPORT)) {
-                       if (afi == AFI_IP) {
+                       if (afi == AFI_IP &&
+                           !BGP_ATTR_NEXTHOP_AFI_IP6(path_vrf->attr)) {
                                /*
                                 * For ipv4, copy to multiprotocol
                                 * nexthop field