summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/punt_api.c
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2020-03-19 08:03:55 +0100
committerJakub Grajciar <jgrajcia@cisco.com>2020-03-19 12:49:55 +0100
commit7dd63e5cc1b48adc4f912778ba79d67c71f94b83 (patch)
tree8d923e3337cb7dc5666c135b4898ad6c5f7adced /src/vnet/ip/punt_api.c
parentf14578972a21fe10cd3ff72aaaaea43da4d74d20 (diff)
ip: change ip API enums address_family and ip_proto size to u8
Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I73d27520726543d6375caad76a841339f68c3533 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'src/vnet/ip/punt_api.c')
-rw-r--r--src/vnet/ip/punt_api.c10
1 files changed, 8 insertions, 2 deletions
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);
}