summaryrefslogtreecommitdiff
path: root/sharpd/sharp_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'sharpd/sharp_zebra.c')
-rw-r--r--sharpd/sharp_zebra.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c
index aa720bacf2..9ff6ba99b6 100644
--- a/sharpd/sharp_zebra.c
+++ b/sharpd/sharp_zebra.c
@@ -563,9 +563,15 @@ void nhg_add(uint32_t id, const struct nexthop_group *nhg,
}
if (api_nhg.nexthop_num == 0) {
- zlog_debug("%s: nhg %u not sent: no valid nexthops", __func__,
- id);
- is_valid = false;
+ if (sharp_nhgroup_id_is_installed(id)) {
+ 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;
+ }
goto done;
}