Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: fix evpn mh esi down #17074

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions bgpd/bgp_evpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3477,9 +3477,8 @@ uninstall_evpn_route_entry_in_vni_mac(struct bgp *bgp, struct bgpevpn *vpn,
* Uninstall route entry from the VRF routing table and send message
* to zebra, if appropriate.
*/
static int uninstall_evpn_route_entry_in_vrf(struct bgp *bgp_vrf,
const struct prefix_evpn *evp,
struct bgp_path_info *parent_pi)
int uninstall_evpn_route_entry_in_vrf(struct bgp *bgp_vrf, const struct prefix_evpn *evp,
struct bgp_path_info *parent_pi)
{
struct bgp_dest *dest;
struct bgp_path_info *pi;
Expand Down Expand Up @@ -3846,10 +3845,8 @@ static int bgp_evpn_route_rmac_self_check(struct bgp *bgp_vrf,
}

/* don't import hosts that are locally attached */
static inline bool
bgp_evpn_skip_vrf_import_of_local_es(struct bgp *bgp_vrf,
const struct prefix_evpn *evp,
struct bgp_path_info *pi, int install)
bool bgp_evpn_skip_vrf_import_of_local_es(struct bgp *bgp_vrf, const struct prefix_evpn *evp,
struct bgp_path_info *pi, int install)
{
esi_t *esi;

Expand Down
4 changes: 4 additions & 0 deletions bgpd/bgp_evpn.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,8 @@ extern enum zclient_send_status
evpn_zebra_uninstall(struct bgp *bgp, struct bgpevpn *vpn,
const struct prefix_evpn *p, struct bgp_path_info *pi,
bool is_sync);
bool bgp_evpn_skip_vrf_import_of_local_es(struct bgp *bgp_vrf, const struct prefix_evpn *evp,
struct bgp_path_info *pi, int install);
int uninstall_evpn_route_entry_in_vrf(struct bgp *bgp_vrf, const struct prefix_evpn *evp,
struct bgp_path_info *parent_pi);
#endif /* _QUAGGA_BGP_EVPN_H */
38 changes: 38 additions & 0 deletions bgpd/bgp_evpn_mh.c
Original file line number Diff line number Diff line change
Expand Up @@ -3807,6 +3807,7 @@ int bgp_evpn_local_es_evi_add(struct bgp *bgp, esi_t *esi, vni_t vni)
bgp_evpn_ead_evi_route_update(bgp, es, vpn, &p);
}

bgp_evpn_local_es_evi_unistall_local_routes_in_vrfs(es, es_evi);
/* update EAD-ES */
if (bgp_evpn_local_es_is_active(es))
bgp_evpn_ead_es_route_update(bgp, es);
Expand Down Expand Up @@ -5058,3 +5059,40 @@ void bgp_evpn_switch_ead_evi_rx(void)
}
}
}

int bgp_evpn_local_es_evi_unistall_local_routes_in_vrfs(struct bgp_evpn_es *es,
struct bgp_evpn_es_evi *es_evi)
{
struct listnode *node;
struct bgp_path_es_info *es_info;
struct bgp_path_info *pi;
const struct prefix_evpn *evp;
struct bgp_evpn_es_vrf *es_vrf = es_evi->es_vrf;

if (!es_vrf)
return 0;

for (ALL_LIST_ELEMENTS_RO(es->macip_global_path_list, node, es_info)) {
pi = es_info->pi;

if (!bgp_evpn_is_macip_path(pi))
continue;

evp = (const struct prefix_evpn *)bgp_dest_get_prefix(pi->net);

if (!(CHECK_FLAG(pi->flags, BGP_PATH_VALID) && pi->type == ZEBRA_ROUTE_BGP &&
pi->sub_type == BGP_ROUTE_NORMAL))
continue;

if (BGP_DEBUG(evpn_mh, EVPN_MH_RT))
zlog_debug("route %pFX is matched on local esi %s, uninstall from route table",
evp, es->esi_str);

if (!bgp_evpn_skip_vrf_import_of_local_es(es_vrf->bgp_vrf, evp, pi, 0))
continue;

uninstall_evpn_route_entry_in_vrf(es_vrf->bgp_vrf, evp, pi);
}

return 0;
}
2 changes: 2 additions & 0 deletions bgpd/bgp_evpn_mh.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,5 +459,7 @@ extern void bgp_evpn_path_nh_add(struct bgp *bgp_vrf, struct bgp_path_info *pi);
extern void bgp_evpn_path_nh_del(struct bgp *bgp_vrf, struct bgp_path_info *pi);
extern void bgp_evpn_mh_config_ead_export_rt(struct bgp *bgp,
struct ecommunity *ecom, bool del);
extern int bgp_evpn_local_es_evi_unistall_local_routes_in_vrfs(struct bgp_evpn_es *es,
struct bgp_evpn_es_evi *es_evi);

#endif /* _FRR_BGP_EVPN_MH_H */
Loading