]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Double check is not necessary in nexthop_active_update
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 16 Apr 2019 13:07:12 +0000 (09:07 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 18 Apr 2019 18:57:54 +0000 (14:57 -0400)
The nexthop_active_update command looks at each individual
nexthop and decides if it has changed.  If any nexthop
has changed we will set the re->status to ROUTE_ENTRY_CHANGED
and ROUTE_ENTRY_NEXTHOPS_CHANGED.

Additionally the test for old_nh_num != curr_active
makes no sense because suppose we have several events
we are processing at the same time and a total ecmp
of 16 but 14 are active at the start and 14 are active
at the end but different interfaces are up or down.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_rib.c

index c6ebb924dde88bc3fe5a4879a9a0ad6f8d45b311..8affb50872d22087ad261554abb41ecd9f883e06 100644 (file)
@@ -940,11 +940,9 @@ static int nexthop_active_update(struct route_node *rn, struct route_entry *re)
 {
        struct nexthop *nexthop;
        union g_addr prev_src;
-       unsigned int prev_active, new_active, old_num_nh;
+       unsigned int prev_active, new_active;
        ifindex_t prev_index;
 
-       old_num_nh = re->nexthop_active_num;
-
        re->nexthop_active_num = 0;
        UNSET_FLAG(re->status, ROUTE_ENTRY_CHANGED);
 
@@ -982,13 +980,6 @@ static int nexthop_active_update(struct route_node *rn, struct route_entry *re)
                }
        }
 
-       if (old_num_nh != re->nexthop_active_num)
-               SET_FLAG(re->status, ROUTE_ENTRY_CHANGED);
-
-       if (CHECK_FLAG(re->status, ROUTE_ENTRY_CHANGED)) {
-               SET_FLAG(re->status, ROUTE_ENTRY_NEXTHOPS_CHANGED);
-       }
-
        return re->nexthop_active_num;
 }