]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: warn if zapi NHG add has no nexthops
authorStephen Worley <sworley@cumulusnetworks.com>
Wed, 20 May 2020 19:43:23 +0000 (15:43 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Mon, 28 Sep 2020 16:40:59 +0000 (12:40 -0400)
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>
zebra/zapi_msg.c

index 4ee4274657a082456dc5f80f85dffe82bf881122..4cd733ea3575714ceaa7138f3d5d2f0949611ad3 100644 (file)
@@ -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];