diff options
author | Klement Sekera <ksekera@cisco.com> | 2018-02-02 16:17:55 +0100 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-02-03 09:36:29 +0000 |
commit | 56e6f095e35799cb1fe2080f5242e3d9876baa22 (patch) | |
tree | 95df2f8e60d859ee5227f8aa7764ef4d406915cb /src/vnet | |
parent | 5a2946c6174f91032792b8e4978c8d235f2281f0 (diff) |
IP reassembly: workaround coverity warnings
Change-Id: Ide577f036d9d8dcedd99cdb4666a0eaf8a19b92e
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/ip/ip4_reassembly.c | 1 | ||||
-rw-r--r-- | src/vnet/ip/ip6_reassembly.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/vnet/ip/ip4_reassembly.c b/src/vnet/ip/ip4_reassembly.c index 6b8d66532fa..7a10271cb44 100644 --- a/src/vnet/ip/ip4_reassembly.c +++ b/src/vnet/ip/ip4_reassembly.c @@ -412,6 +412,7 @@ ip4_reass_finalize (vlib_main_t * vm, vlib_node_runtime_t * node, trim_front = 0; trim_end = vlib_buffer_length_in_chain (vm, tmp) - data_len - ip4_header_bytes (ip); + ASSERT (vlib_buffer_length_in_chain (vm, tmp) - trim_end > 0); } u32 keep_data = vlib_buffer_length_in_chain (vm, tmp) - trim_front - trim_end; diff --git a/src/vnet/ip/ip6_reassembly.c b/src/vnet/ip/ip6_reassembly.c index d448032b913..5a7c081055b 100644 --- a/src/vnet/ip/ip6_reassembly.c +++ b/src/vnet/ip/ip6_reassembly.c @@ -451,6 +451,7 @@ ip6_reass_finalize (vlib_main_t * vm, vlib_node_runtime_t * node, trim_end = vlib_buffer_length_in_chain (vm, tmp) - data_len - (vnet_buffer (tmp)->ip.reass.ip6_frag_hdr_offset + sizeof (*frag_hdr)); + ASSERT (vlib_buffer_length_in_chain (vm, tmp) - trim_end > 0); } u32 keep_data = vlib_buffer_length_in_chain (vm, tmp) - trim_front - trim_end; |