tcp: fix retransmissions under buffer shortage
[vpp.git] / src / vnet / tcp / tcp_input.c
index 614b94a..702a94f 100644 (file)
@@ -3001,6 +3001,9 @@ tcp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
              goto done;
            }
 
+         vnet_buffer (b0)->tcp.hdr_offset = (u8 *) tcp0
+           - (u8 *) vlib_buffer_get_current (b0);
+
          /* Session exists */
          if (PREDICT_TRUE (0 != tconn))
            {
@@ -3014,8 +3017,6 @@ tcp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
              vnet_buffer (b0)->tcp.ack_number =
                clib_net_to_host_u32 (tcp0->ack_number);
 
-             vnet_buffer (b0)->tcp.hdr_offset = (u8 *) tcp0
-               - (u8 *) vlib_buffer_get_current (b0);
              vnet_buffer (b0)->tcp.data_offset = n_advance_bytes0;
              vnet_buffer (b0)->tcp.data_len = n_data_bytes0;