From 9f570418a38bc00299a757328cc062e13cda98e7 Mon Sep 17 00:00:00 2001 From: Anuradha Karuppiah Date: Fri, 4 Sep 2020 08:19:49 -0700 Subject: [PATCH] bgpd: Disable L3NHG support for routes leaked from another VRF Theoretically we should just be able to use the L3 NHG in the other-VRF/nh-VRF. But there is some change list handling (when an ES is added to or removed from a VRF) that needs to be updated to account for routes in other VRFs using that ES-VRF as nexthop. Till that is done we will disable L3-NHG use for routes leaked from a different VRF. Route in tenant2 with ES/NHG as destination - =========================================== root@leaf11:mgmt:~# ip route show vrf tenant2 22.1.0.7 22.1.0.7 nhid 75000012 proto bgp metric 20 root@leaf11:mgmt:~# ip nexthop list id 75000012 id 75000012 group 103/107/111 proto bgp root@leaf11:mgmt:~# ip nexthop |grep "103\|107\|111" id 103 via 6.0.0.11 dev vlan12 scope link proto bgp onlink id 107 via 6.0.0.12 dev vlan12 scope link proto bgp onlink id 111 via 6.0.0.13 dev vlan12 scope link proto bgp onlink id 75000012 group 103/107/111 proto bgp root@leaf11:mgmt:~# Leaked into VRF1 with a flat/exploded mpaths ============================================ root@leaf11:mgmt:~# ip route show vrf tenant1 |grep -A3 22.1.0.7 22.1.0.7 proto bgp metric 20 nexthop via 6.0.0.11 dev vlan12 weight 1 onlink nexthop via 6.0.0.12 dev vlan12 weight 1 onlink nexthop via 6.0.0.13 dev vlan12 weight 1 onlink root@leaf11:mgmt:~# Ticket: CM-31115 Signed-off-by: Anuradha Karuppiah --- bgpd/bgp_evpn_mh.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c index 022a09aa6a..dc6a7dd431 100644 --- a/bgpd/bgp_evpn_mh.c +++ b/bgpd/bgp_evpn_mh.c @@ -2723,6 +2723,10 @@ bool bgp_evpn_path_es_use_nhg(struct bgp *bgp_vrf, struct bgp_path_info *pi, *nhg_p = 0; + /* we don't support NHG for routes leaked from another VRF yet */ + if (pi->extra && pi->extra->bgp_orig) + return false; + parent_pi = get_route_parent_evpn(pi); if (!parent_pi) return false; -- 2.39.5