Skip to content

Commit

Permalink
zebra: clarify error when calling zebra_nhg_rib_find_nhe()
Browse files Browse the repository at this point in the history
Display a specific log message when the rt_nhe parameter is not
set at all.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Nov 27, 2023
1 parent 6d0c978 commit 3778824
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion zebra/zebra_nhg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,13 @@ zebra_nhg_rib_find_nhe(struct nhg_hash_entry *rt_nhe, afi_t rt_afi)
{
struct nhg_hash_entry *nhe = NULL;

if (!(rt_nhe && rt_nhe->nhg.nexthop)) {
if (!rt_nhe) {
flog_err(EC_ZEBRA_TABLE_LOOKUP_FAILED,
"No nhg_hash_entry passed to %s", __func__);
return NULL;
}

if (!rt_nhe->nhg.nexthop) {
flog_err(EC_ZEBRA_TABLE_LOOKUP_FAILED,
"No nexthop passed to %s", __func__);
return NULL;
Expand Down

0 comments on commit 3778824

Please sign in to comment.