From: Stephen Worley Date: Wed, 20 May 2020 19:43:23 +0000 (-0400) Subject: zebra: warn if zapi NHG add has no nexthops X-Git-Tag: base_7.6~489^2~31 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=68671c74390fdb746568413e6d2150cae4c2d4b9;p=matthieu%2Ffrr.git zebra: warn if zapi NHG add has no nexthops Log a warning and return if we receive a NHG add via zapi that has no nexthops. Signed-off-by: Stephen Worley --- diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 4ee4274657..4cd733ea35 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1783,6 +1783,12 @@ static void zread_nhg_reader(ZAPI_HANDLER_ARGS) // if (zserv_nexthop_num_warn(__func__, &p, nhops)) // return; + if (nhops <= 0) { + flog_warn(EC_ZEBRA_NEXTHOP_CREATION_FAILED, + "%s: No nexthops sent", __func__); + return; + } + for (i = 0; i < nhops; i++) { struct zapi_nexthop *znh = &zapi_nexthops[i];