ip: reassembly fix sanity checks 28/23028/4
authorKlement Sekera <ksekera@cisco.com>
Mon, 28 Oct 2019 11:26:28 +0000 (11:26 +0000)
committerOle Trøan <otroan@employees.org>
Mon, 28 Oct 2019 14:00:59 +0000 (14:00 +0000)
use correct value for sanity checks

Type: fix

Change-Id: If33db5ce3e4a26f7876c2a67832ca2947563e211
Signed-off-by: Klement Sekera <ksekera@cisco.com>
src/vnet/ip/reass/ip6_full_reass.c
src/vnet/ip/reass/ip6_sv_reass.c

index 4e9079d..7f56d2c 100644 (file)
@@ -1092,6 +1092,9 @@ ip6_full_reassembly_inline (vlib_main_t * vm,
              next0 = IP6_FULL_REASSEMBLY_NEXT_INPUT;
              goto skip_reass;
            }
+         vnet_buffer (b0)->ip.reass.ip6_frag_hdr_offset =
+           (u8 *) frag_hdr - (u8 *) ip0;
+
          if (0 == ip6_frag_hdr_offset (frag_hdr))
            {
              // first fragment - verify upper-layer is present
@@ -1110,9 +1113,6 @@ ip6_full_reassembly_inline (vlib_main_t * vm,
              next0 = IP6_FULL_REASSEMBLY_NEXT_ICMP_ERROR;
              goto skip_reass;
            }
-         vnet_buffer (b0)->ip.reass.ip6_frag_hdr_offset =
-           (u8 *) frag_hdr - (u8 *) ip0;
-
          ip6_full_reass_kv_t kv;
          u8 do_handoff = 0;
 
index a7f360e..9601cc3 100644 (file)
@@ -546,6 +546,8 @@ ip6_sv_reassembly_inline (vlib_main_t * vm,
              next0 = IP6_SV_REASSEMBLY_NEXT_INPUT;
              goto packet_enqueue;
            }
+         vnet_buffer (b0)->ip.reass.ip6_frag_hdr_offset =
+           (u8 *) frag_hdr - (u8 *) ip0;
          if (0 == ip6_frag_hdr_offset (frag_hdr))
            {
              // first fragment - verify upper-layer is present
@@ -564,8 +566,6 @@ ip6_sv_reassembly_inline (vlib_main_t * vm,
              next0 = IP6_SV_REASSEMBLY_NEXT_ICMP_ERROR;
              goto packet_enqueue;
            }
-         vnet_buffer (b0)->ip.reass.ip6_frag_hdr_offset =
-           (u8 *) frag_hdr - (u8 *) ip0;
 
          ip6_sv_reass_kv_t kv;
          u8 do_handoff = 0;