Skip to content

Commit

Permalink
sharpd: fix deleting nhid when suppressing nexthop from nh group
Browse files Browse the repository at this point in the history
When no nexthops are in a nexthop group, two successive events are
sent: NHG_DEL and NHG_ADD, but only the NHG_DEL one is necessary.
Fixes this by returning in the nhg_add() function.

Fixes: 82beaf6 ("sharpd: fix deleting nhid when suppressing nexthop from nh group")
  • Loading branch information
pguibert6WIND committed Dec 5, 2023
1 parent 6be9452 commit 1c7748e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sharpd/sharp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,11 +567,11 @@ void nhg_add(uint32_t id, const struct nexthop_group *nhg,
zlog_debug("%s: nhg %u: no nexthops, deleting nexthop group", __func__,
id);
zclient_nhg_send(zclient, ZEBRA_NHG_DEL, &api_nhg);
} else {
zlog_debug("%s: nhg %u not sent: no valid nexthops", __func__,
id);
is_valid = false;
return;
}
zlog_debug("%s: nhg %u not sent: no valid nexthops", __func__,
id);
is_valid = false;
goto done;
}

Expand Down

0 comments on commit 1c7748e

Please sign in to comment.