zebra: Ensure that we properly decode the zapi_route sent to us

Ensure that we have properly decoded the zapi_route sent to us
and if we cannot decode, log and move on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-03-20 18:48:12 -04:00
parent af5849b662
commit 98a217f0d0

View File

@ -1168,7 +1168,12 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
struct ipaddr vtep_ip;
s = msg;
zapi_route_decode(s, &api);
if (zapi_route_decode(s, &api) < 0) {
if (IS_ZEBRA_DEBUG_RECV)
zlog_debug("%s: Unable to decode zapi_route sent",
__PRETTY_FUNCTION__);
return;
}
if (IS_ZEBRA_DEBUG_RECV) {
char buf_prefix[PREFIX_STRLEN];