summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-02-05 08:34:47 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-02-05 08:34:47 -0500
commit7d30a95973ee3b5f28ce7315bc331fde694b1305 (patch)
tree281aa1f14c9ff558a8d7b2f1e763095356beeb0f
parent4a749e2cb20a0b473e7f1e7e17d8f2b8a4469aef (diff)
bgpd, pimd: Handle return code for nexthop_decode
Appropriately handle the return code for the zapi_nexthop_update_decode call. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--bgpd/bgp_nht.c7
-rw-r--r--pimd/pim_nht.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index e595a15196..d39fbec86d 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -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(
diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c
index 7b35ca0209..5b297253b2 100644
--- a/pimd/pim_nht.c
+++ b/pimd/pim_nht.c
@@ -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);