]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: move non-best local path checks outside the function 3202/head
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Fri, 19 Oct 2018 15:46:46 +0000 (08:46 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 31 Oct 2018 10:23:32 +0000 (06:23 -0400)
This change is a fixup to -
7b5e18 -  bgpd: use IP address as tie breaker if the MM seq number is the
same

And is being done in response to review comments. This commit brings no
functional change; simply moves around code for easier maintanence.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
bgpd/bgp_evpn.c

index 961e3b84dee535599caa2751a6bc0f0c4b833f3f..ae00534c399cc590fa750917c97e289e1d320f1f 100644 (file)
@@ -1702,25 +1702,18 @@ static int update_evpn_route_entry(struct bgp *bgp, struct bgpevpn *vpn,
 static void evpn_cleanup_local_non_best_route(struct bgp *bgp,
                                              struct bgpevpn *vpn,
                                              struct bgp_node *rn,
-                                             struct bgp_path_info *local_pi,
-                                             int *route_change)
+                                             struct bgp_path_info *local_pi)
 {
        struct bgp_path_info *tmp_pi;
        struct bgp_path_info *curr_select = NULL;
        uint8_t flags = 0;
        char buf[PREFIX_STRLEN];
 
-       if (CHECK_FLAG(local_pi->flags, BGP_PATH_SELECTED)) {
-               /* local path is the winner; no additional cleanup needed */
-               return;
-       }
-
        /* local path was not picked as the winner; kick it out */
        if (bgp_debug_zebra(NULL)) {
                zlog_debug("evicting local evpn prefix %s as remote won",
                                        prefix2str(&rn->p, buf, sizeof(buf)));
        }
-       *route_change = 0;
        evpn_delete_old_local_route(bgp, vpn, rn, local_pi);
        bgp_path_info_reap(rn, local_pi);
 
@@ -1813,10 +1806,14 @@ static int update_evpn_route(struct bgp *bgp, struct bgpevpn *vpn,
         */
        evpn_route_select_install(bgp, vpn, rn);
        /*
-        * if the new local route was not selected evict it and tell zebra
-        * to add the best remote dest
+        * If the new local route was not selected evict it and tell zebra
+        * to re-add the best remote dest. BGP doesn't retain non-best local
+        * routes.
         */
-       evpn_cleanup_local_non_best_route(bgp, vpn, rn, pi, &route_change);
+       if (!CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)) {
+               route_change = 0;
+               evpn_cleanup_local_non_best_route(bgp, vpn, rn, pi);
+       }
        bgp_path_info_unlock(pi);
 
        bgp_unlock_node(rn);