Skip to content

Commit

Permalink
zebra: Cleanup dest assignment
Browse files Browse the repository at this point in the history
dest was shadowing dest inside of an if statement additionally
both legs needed dest to be assigned.  Let's clean this up a
slight bit and use it appropriately

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Jan 24, 2024
1 parent a5613bd commit 8d5ed65
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions zebra/zebra_rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2874,19 +2874,17 @@ static void process_subq_early_route_add(struct zebra_early_route *ere)
SET_FLAG(re->status, ROUTE_ENTRY_CHANGED);
rib_addnode(rn, re, 1);

dest = rib_dest_from_rnode(rn);
/* Free implicit route.*/
if (same) {
rib_dest_t *dest = rn->info;

if (same == dest->selected_fib)
if (dest && same == dest->selected_fib)
SET_FLAG(same->status, ROUTE_ENTRY_ROUTE_REPLACING);
rib_delnode(rn, same);
}

/* See if we can remove some RE entries that are queued for
* removal, but won't be considered in rib processing.
*/
dest = rib_dest_from_rnode(rn);
RNODE_FOREACH_RE_SAFE (rn, re, same) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED)) {
/* If the route was used earlier, must retain it. */
Expand Down

0 comments on commit 8d5ed65

Please sign in to comment.