]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix wrong check on local es routes 10816/head
authoranlan_cs <vic.lan@pica8.com>
Wed, 16 Mar 2022 13:38:17 +0000 (21:38 +0800)
committeranlan_cs <vic.lan@pica8.com>
Thu, 17 Mar 2022 13:46:44 +0000 (21:46 +0800)
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>
bgpd/bgp_evpn.c

index a9c006ca2b9ffd9c252565798e1551d983216cef..5450b5ca77fa08e9253a3777c22a3b7c65225136 100644 (file)
@@ -3036,9 +3036,11 @@ int bgp_evpn_route_entry_install_if_vrf_match(struct bgp *bgp_vrf,
                        return 0;
 
                /* don't import hosts that are locally attached */
-               if (install
-                   && !bgp_evpn_skip_vrf_import_of_local_es(bgp_vrf, evp, pi,
-                                                            install))
+               if (install && bgp_evpn_skip_vrf_import_of_local_es(
+                                      bgp_vrf, evp, pi, install))
+                       return 0;
+
+               if (install)
                        ret = install_evpn_route_entry_in_vrf(bgp_vrf, evp, pi);
                else
                        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;
 
                /* don't import hosts that are locally attached */
-               if (install
-                   && !bgp_evpn_skip_vrf_import_of_local_es(bgp_vrf, evp, pi,
-                                                            install))
+               if (install && bgp_evpn_skip_vrf_import_of_local_es(
+                                      bgp_vrf, evp, pi, install))
+                       return 0;
+
+               if (install)
                        ret = install_evpn_route_entry_in_vrf(bgp_vrf, evp, pi);
                else
                        ret = uninstall_evpn_route_entry_in_vrf(bgp_vrf, evp,