diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2023-12-04 16:03:31 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2023-12-05 08:20:24 +0100 |
commit | 82c1d82d7767570af287b8fa8d887ba8a40015e3 (patch) | |
tree | 07920eb43fefdd7056bccf04d747d73535ca8f14 /sharpd | |
parent | Merge pull request #14938 from rampxxxx/ubi8_protobuf (diff) | |
download | frr-82c1d82d7767570af287b8fa8d887ba8a40015e3.tar.xz frr-82c1d82d7767570af287b8fa8d887ba8a40015e3.zip |
sharpd: fix deleting nhid when suppressing nexthop from nh group
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: 82beaf6ae520 ("sharpd: fix deleting nhid when suppressing nexthop from nh group")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'sharpd')
-rw-r--r-- | sharpd/sharp_zebra.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c index 9ff6ba99b..7c7925651 100644 --- a/sharpd/sharp_zebra.c +++ b/sharpd/sharp_zebra.c @@ -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; } |