Skip to content

Commit

Permalink
Merge pull request #14937 from pguibert6WIND/fix_nhid_suppress
Browse files Browse the repository at this point in the history
sharpd: fix deleting nhid when suppressing nexthop from nh group
  • Loading branch information
riw777 authored Dec 6, 2023
2 parents 27855cb + f806ec1 commit 04fe6df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion sharpd/sharp_nht.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ static void sharp_nhgroup_delete_cb(const char *name)
if (!snhg)
return;

nhg_del(snhg->id);
if (sharp_nhgroup_id_is_installed(snhg->id))
nhg_del(snhg->id);
sharp_nhg_rb_del(&nhg_head, snhg);
XFREE(MTYPE_NHG, snhg);
}
Expand Down
9 changes: 5 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 Expand Up @@ -934,6 +934,7 @@ static int nhg_notify_owner(ZAPI_CALLBACK_ARGS)
zlog_debug("Failed install of nhg %u", id);
break;
case ZAPI_NHG_REMOVED:
sharp_nhgroup_id_set_installed(id, false);
zlog_debug("Removed nhg %u", id);
break;
case ZAPI_NHG_REMOVE_FAIL:
Expand Down

0 comments on commit 04fe6df

Please sign in to comment.