]> git.puffer.fish Git - mirror/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>
Thu, 26 Mar 2020 14:48:15 +0000 (10:48 -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>
zebra/zebra_nhg.c

index 6a14e53b4b36afcd07f5ee27261619ed7269ec08..6956d4d34eb8dabe910de6529ac26a8220c07f7d 100644 (file)
@@ -1811,19 +1811,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