summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyoga Saito <ryoga.saito@linecorp.com>2022-12-04 23:51:45 +0900
committerRyoga Saito <ryoga.saito@linecorp.com>2022-12-05 00:06:40 +0900
commitf784007d677ee20e4dbd20366928652be2a0b23c (patch)
treedadc09c7f4b0be7a92d3d4a16059552f3100fd31
parentc7e804c900a6cac81ad0c726093e41f64b739bc0 (diff)
bgpd: Stop overriding nexthop when BGP unnumberred
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>
-rw-r--r--bgpd/bgp_mplsvpn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index 18cb90763c..ace75976a9 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -1505,7 +1505,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