summaryrefslogtreecommitdiffstats
path: root/zebra/zapi_msg.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2020-05-20 21:43:23 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2020-09-28 18:40:59 +0200
commit68671c74390fdb746568413e6d2150cae4c2d4b9 (patch)
tree402491ef299747473b3a6fd1ab04a1a558af6089 /zebra/zapi_msg.c
parentzebra: handle proto NHG uninstall client disconnect (diff)
downloadfrr-68671c74390fdb746568413e6d2150cae4c2d4b9.tar.xz
frr-68671c74390fdb746568413e6d2150cae4c2d4b9.zip
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 <sworley@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--zebra/zapi_msg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 4ee427465..4cd733ea3 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];