diff options
Diffstat (limited to 'bgpd/bgp_evpn.c')
| -rw-r--r-- | bgpd/bgp_evpn.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 07d3f7b31e..35d54983dc 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -2583,6 +2583,8 @@ static int install_evpn_route_entry_in_vrf(struct bgp *bgp_vrf, /* Process for route leaking. */ vpn_leak_from_vrf_update(bgp_get_default(), bgp_vrf, pi); + bgp_unlock_node(rn); + return ret; } @@ -2638,6 +2640,8 @@ static int install_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn, /* Perform route selection and update zebra, if required. */ ret = evpn_route_select_install(bgp, vpn, rn); + bgp_unlock_node(rn); + return ret; } @@ -6026,3 +6030,26 @@ int bgp_evpn_get_type5_prefixlen(struct prefix *pfx) return evp->prefix.prefix_addr.ip_prefix_length; } + +/* + * Should we register nexthop for this EVPN prefix for nexthop tracking? + */ +bool bgp_evpn_is_prefix_nht_supported(struct prefix *pfx) +{ + struct prefix_evpn *evp = (struct prefix_evpn *)pfx; + + /* + * EVPN RT-5 should not be marked as valid and imported to vrfs if the + * BGP nexthop is not reachable. To check for the nexthop reachability, + * Add nexthop for EVPN RT-5 for nexthop tracking. + * + * Ideally, a BGP route should be marked as valid only if the + * nexthop is reachable. Thus, other EVPN route types also should be + * added here after testing is performed for them. + */ + if (pfx && pfx->family == AF_EVPN && + evp->prefix.route_type == BGP_EVPN_IP_PREFIX_ROUTE) + return true; + + return false; +} |
