]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: set valid on re->nhe directly in nexthop_active_update()
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 30 Jan 2020 17:34:35 +0000 (12:34 -0500)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 3 Apr 2020 19:12:36 +0000 (15:12 -0400)
We were still doing a lookup on the nhe_id from before we
started referencing re->nhe directly.

Change set flag to just use re->nhe directly here since they
should always be the same at this point in the code anyway.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
(cherry picked from commit 715e5c70d564017a8b709599e23bf94884ab9bb9)

zebra/zebra_nhg.c

index cffbc9f061f78cd16ebc259c4215e981bc6a59ae..7bdfc12a45529c5046df137a9bf8d4c2ca5e427e 100644 (file)
@@ -1783,19 +1783,8 @@ int nexthop_active_update(struct route_node *rn, struct route_entry *re)
                route_entry_update_nhe(re, new_nhe);
        }
 
-       if (curr_active) {
-               struct nhg_hash_entry *nhe = NULL;
-
-               nhe = zebra_nhg_lookup_id(re->nhe_id);
-
-               if (nhe)
-                       SET_FLAG(nhe->flags, NEXTHOP_GROUP_VALID);
-               else
-                       flog_err(
-                               EC_ZEBRA_TABLE_LOOKUP_FAILED,
-                               "Active update on NHE id=%u that we do not have in our tables",
-                               re->nhe_id);
-       }
+       if (curr_active)
+               SET_FLAG(re->nhe->flags, NEXTHOP_GROUP_VALID);
 
        /*
         * Do not need these nexthops anymore since they