summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2020-05-26 10:38:05 +0000
committerOle Trøan <otroan@employees.org>2020-05-27 14:29:21 +0000
commit11492291e660bcf0a362943b49b7854b4510e94c (patch)
tree8e08d7092023d3267d4483e366aec41ff5cdedd4
parent9121c415a91904be50071ec55143d9c89b2f1b91 (diff)
ip: reassembly: use correct IP header offset
Type: fix Ticket: VPP-1883 Signed-off-by: Klement Sekera <ksekera@cisco.com> Change-Id: Icf50a645e114fa3b7bd974f8c82f5ceebfcedcd7
-rw-r--r--src/vnet/ip/reass/ip4_sv_reass.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vnet/ip/reass/ip4_sv_reass.c b/src/vnet/ip/reass/ip4_sv_reass.c
index bc7da306006..b41498e2296 100644
--- a/src/vnet/ip/reass/ip4_sv_reass.c
+++ b/src/vnet/ip/reass/ip4_sv_reass.c
@@ -451,7 +451,7 @@ ip4_sv_reass_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
ip4_header_t *ip0 =
(ip4_header_t *) u8_ptr_add (vlib_buffer_get_current (b0),
- is_output_feature *
+ (is_output_feature ? 1 : 0) *
vnet_buffer (b0)->
ip.save_rewrite_length);
if (!ip4_get_fragment_more (ip0) && !ip4_get_fragment_offset (ip0))
@@ -597,6 +597,11 @@ ip4_sv_reass_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
{
u32 bi0 = vec_elt (reass->cached_buffers, idx);
vlib_buffer_t *b0 = vlib_get_buffer (vm, bi0);
+ ip0 =
+ (ip4_header_t *) u8_ptr_add (vlib_buffer_get_current (b0),
+ (is_output_feature ? 1 : 0) *
+ vnet_buffer (b0)->
+ ip.save_rewrite_length);
u32 next0 = IP4_SV_REASSEMBLY_NEXT_INPUT;
if (is_feature)
{
@@ -617,7 +622,7 @@ ip4_sv_reass_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
to_next += 1;
n_left_to_next -= 1;
vnet_buffer (b0)->ip.reass.is_non_first_fragment =
- ! !ip4_get_fragment_offset (vlib_buffer_get_current (b0));
+ ! !ip4_get_fragment_offset (ip0);
vnet_buffer (b0)->ip.reass.ip_proto = reass->ip_proto;
vnet_buffer (b0)->ip.reass.icmp_type_or_tcp_flags =
reass->icmp_type_or_tcp_flags;