summaryrefslogtreecommitdiffstats
path: root/pimd/pim_nht.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-03-31 22:38:29 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-03-31 22:38:29 +0200
commit8cb129e9868eb5edb7bfe98917fad9931de6144b (patch)
treef4758c2d2c43543949acb2e7dfbce885be704ef2 /pimd/pim_nht.c
parentpimd: Cleanup unused variable write (diff)
downloadfrr-8cb129e9868eb5edb7bfe98917fad9931de6144b.tar.xz
frr-8cb129e9868eb5edb7bfe98917fad9931de6144b.zip
pimd: Cleanup api and stop crash
There is no need for a function that calls another function. Additionally, nexthop_updates from zebra can be either ZEBRA_NEXTHOP_UPDATE -or- ZEBRA_IMPORT_CHECK_UPDATE If we were to receive a IMPORT_CHECK_UPDATE the code would cause a immediate crash. Fix this Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_nht.c')
-rw-r--r--pimd/pim_nht.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c
index c9ae67322..5395c0839 100644
--- a/pimd/pim_nht.c
+++ b/pimd/pim_nht.c
@@ -462,10 +462,13 @@ pim_update_upstream_nh (struct pim_nexthop_cache *pnc)
return 0;
}
-/* This API is used to parse Registered address nexthop update coming from Zebra */
-void
-pim_parse_nexthop_update (struct zclient *zclient, int command,
- vrf_id_t vrf_id)
+/*
+ * This API is used to parse Registered address nexthop update
+ * coming from Zebra
+ */
+int
+pim_parse_nexthop_update (int command, struct zclient *zclient,
+ zebra_size_t length, vrf_id_t vrf_id)
{
struct stream *s;
struct prefix p;
@@ -512,9 +515,16 @@ pim_parse_nexthop_update (struct zclient *zclient, int command,
zlog_debug ("%s: NHT addr %s is not in local cached DB.",
__PRETTY_FUNCTION__, buf);
}
- return;
+ return 0;
}
}
+ else
+ {
+ /*
+ * We do not currently handle ZEBRA_IMPORT_CHECK_UPDATE
+ */
+ return 0;
+ }
pnc->last_update = pim_time_monotonic_sec ();
distance = stream_getc (s);
@@ -644,4 +654,5 @@ pim_parse_nexthop_update (struct zclient *zclient, int command,
if (listcount (pnc->upstream_list))
pim_update_upstream_nh (pnc);
+ return 0;
}