From 7dd63e5cc1b48adc4f912778ba79d67c71f94b83 Mon Sep 17 00:00:00 2001 From: Jakub Grajciar Date: Thu, 19 Mar 2020 08:03:55 +0100 Subject: ip: change ip API enums address_family and ip_proto size to u8 Type: fix Signed-off-by: Jakub Grajciar Change-Id: I73d27520726543d6375caad76a841339f68c3533 Signed-off-by: Jakub Grajciar --- src/vnet/ip/punt_api.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/vnet/ip/punt_api.c') diff --git a/src/vnet/ip/punt_api.c b/src/vnet/ip/punt_api.c index 077b1ac3a69..2acf8265dc1 100644 --- a/src/vnet/ip/punt_api.c +++ b/src/vnet/ip/punt_api.c @@ -89,7 +89,11 @@ vl_api_punt_l4_decode (const vl_api_punt_l4_t * in, punt_l4_t * out) int rv; rv = ip_address_family_decode (in->af, &out->af); - rv += ip_proto_decode (in->protocol, &out->protocol); + if (rv < 0) + return (rv); + rv = ip_proto_decode (in->protocol, &out->protocol); + if (rv < 0) + return (rv); out->port = clib_net_to_host_u16 (in->port); return (rv); @@ -102,7 +106,9 @@ vl_api_punt_ip_proto_decode (const vl_api_punt_ip_proto_t * in, int rv; rv = ip_address_family_decode (in->af, &out->af); - rv += ip_proto_decode (in->protocol, &out->protocol); + if (rv < 0) + return (rv); + rv = ip_proto_decode (in->protocol, &out->protocol); return (rv); } -- cgit 1.2.3-korg