zebra: clarify error when calling zebra_nhg_rib_find_nhe()

Display a specific log message when the rt_nhe parameter is not
set at all.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2023-09-04 15:43:37 +02:00
parent 82beaf6ae5
commit 427d3f81f4

View File

@ -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;