]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd, pimd: Handle return code for nexthop_decode 1712/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 5 Feb 2018 13:34:47 +0000 (08:34 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 5 Feb 2018 13:34:47 +0000 (08:34 -0500)
Appropriately handle the return code for the
zapi_nexthop_update_decode call.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_nht.c
pimd/pim_nht.c

index e595a1519623378a5451fdc2e33ab78185af106a..d39fbec86dedffa88d5543308c9ffc9e868b6804 100644 (file)
@@ -338,7 +338,12 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
                return;
        }
 
-       zapi_nexthop_update_decode(zclient->ibuf, &nhr);
+       if (!zapi_nexthop_update_decode(zclient->ibuf, &nhr)) {
+               if (BGP_DEBUG(nht, NHT))
+                       zlog_debug("%s: Failure to decode nexthop update",
+                                  __PRETTY_FUNCTION__);
+               return;
+       }
 
        if (command == ZEBRA_NEXTHOP_UPDATE)
                rn = bgp_node_lookup(
index 7b35ca020916032c6b5f4fcdde6482d1727f758d..5b297253b2fbb2ce73639625f0136e96937e058d 100644 (file)
@@ -625,7 +625,12 @@ int pim_parse_nexthop_update(int command, struct zclient *zclient,
                return 0;
        pim = vrf->info;
 
-       zapi_nexthop_update_decode(zclient->ibuf, &nhr);
+       if (!zapi_nexthop_update_decode(zclient->ibuf, &nhr)) {
+               if (PIM_DEBUG_PIM_NHT)
+                       zlog_debug("%s: Decode of nexthop update from zebra failed",
+                                  __PRETTY_FUNCTION__);
+               return 0;
+       }
 
        if (command == ZEBRA_NEXTHOP_UPDATE) {
                prefix_copy(&rpf.rpf_addr, &nhr.prefix);