bgpd: fix wrong check on local es routes

Importing local es routes should be skipped. But the check of it is a bit wrong.
It is ok that local es routes can't be imported, but importing local es will
wrongly enter `uninstall` procedure.

Just adjust this check to make it clear. Immediately return in the case
of importing local es routes.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
This commit is contained in:
anlan_cs 2022-03-16 21:38:17 +08:00
parent 79f4d05c7a
commit e57e63eb40

View File

@ -3036,9 +3036,11 @@ int bgp_evpn_route_entry_install_if_vrf_match(struct bgp *bgp_vrf,
return 0; return 0;
/* don't import hosts that are locally attached */ /* don't import hosts that are locally attached */
if (install if (install && bgp_evpn_skip_vrf_import_of_local_es(
&& !bgp_evpn_skip_vrf_import_of_local_es(bgp_vrf, evp, pi, bgp_vrf, evp, pi, install))
install)) return 0;
if (install)
ret = install_evpn_route_entry_in_vrf(bgp_vrf, evp, pi); ret = install_evpn_route_entry_in_vrf(bgp_vrf, evp, pi);
else else
ret = uninstall_evpn_route_entry_in_vrf(bgp_vrf, evp, ret = uninstall_evpn_route_entry_in_vrf(bgp_vrf, evp,
@ -3291,9 +3293,11 @@ static int install_uninstall_route_in_vrfs(struct bgp *bgp_def, afi_t afi,
int ret; int ret;
/* don't import hosts that are locally attached */ /* don't import hosts that are locally attached */
if (install if (install && bgp_evpn_skip_vrf_import_of_local_es(
&& !bgp_evpn_skip_vrf_import_of_local_es(bgp_vrf, evp, pi, bgp_vrf, evp, pi, install))
install)) return 0;
if (install)
ret = install_evpn_route_entry_in_vrf(bgp_vrf, evp, pi); ret = install_evpn_route_entry_in_vrf(bgp_vrf, evp, pi);
else else
ret = uninstall_evpn_route_entry_in_vrf(bgp_vrf, evp, ret = uninstall_evpn_route_entry_in_vrf(bgp_vrf, evp,