From 80ad04184f2e0b20bf8d0eff8fdd94fc1fb690da Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 16 Apr 2019 09:07:12 -0400 Subject: [PATCH] zebra: Double check is not necessary in nexthop_active_update 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 --- zebra/zebra_rib.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index c6ebb924dd..8affb50872 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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; }