if (is_ip4)
{
ih4 = vlib_buffer_push_ip4 (vm, b0, &dst_ip40, &src_ip40,
- IP_PROTOCOL_TCP);
+ IP_PROTOCOL_TCP, 1);
th0->checksum = ip4_tcp_udp_compute_checksum (vm, b0, ih4);
}
else
{
ASSERT ((pkt_ih4->ip_version_and_header_length & 0xF0) == 0x40);
ih4 = vlib_buffer_push_ip4 (vm, b, &pkt_ih4->dst_address,
- &pkt_ih4->src_address, IP_PROTOCOL_TCP);
+ &pkt_ih4->src_address, IP_PROTOCOL_TCP, 1);
th->checksum = ip4_tcp_udp_compute_checksum (vm, b, ih4);
}
else
{
ip4_header_t *ih;
ih = vlib_buffer_push_ip4 (vm, b, &tc->c_lcl_ip4,
- &tc->c_rmt_ip4, IP_PROTOCOL_TCP);
+ &tc->c_rmt_ip4, IP_PROTOCOL_TCP, 1);
th->checksum = ip4_tcp_udp_compute_checksum (vm, b, ih);
}
else
if (is_syn)
{
tc = tcp_half_open_connection_get (index);
+ tc->timers[TCP_TIMER_RETRANSMIT_SYN] = TCP_TIMER_HANDLE_INVALID;
}
else
{
tc = tcp_connection_get (index, thread_index);
+ tc->timers[TCP_TIMER_RETRANSMIT] = TCP_TIMER_HANDLE_INVALID;
}
- /* Make sure timer handle is set to invalid */
- tc->timers[TCP_TIMER_RETRANSMIT] = TCP_TIMER_HANDLE_INVALID;
-
if (!tcp_in_recovery (tc) && tc->rto_boff > 0
&& tc->state >= TCP_STATE_ESTABLISHED)
{
/* Retransmit for SYN/SYNACK */
else if (tc->state == TCP_STATE_SYN_RCVD || tc->state == TCP_STATE_SYN_SENT)
{
+ /* Half-open connection actually moved to established but we were
+ * waiting for syn retransmit to pop to call cleanup from the right
+ * thread. */
+ if (tc->flags & TCP_CONN_HALF_OPEN_DONE)
+ {
+ ASSERT (tc->state == TCP_STATE_SYN_SENT);
+ if (tcp_half_open_connection_cleanup (tc))
+ {
+ clib_warning ("could not remove half-open connection");
+ ASSERT (0);
+ }
+ return;
+ }
+
/* Try without increasing RTO a number of times. If this fails,
* start growing RTO exponentially */
if (tc->rto_boff > TCP_RTO_SYN_RETRIES)
{
ip4_header_t *ih0;
ih0 = vlib_buffer_push_ip4 (vm, b0, &tc0->c_lcl_ip4,
- &tc0->c_rmt_ip4, IP_PROTOCOL_TCP);
- b0->flags |= VNET_BUFFER_F_IS_IP4 |
- VNET_BUFFER_F_OFFLOAD_IP_CKSUM |
+ &tc0->c_rmt_ip4, IP_PROTOCOL_TCP,
+ 1);
+ b0->flags |=
+ VNET_BUFFER_F_IS_IP4 | VNET_BUFFER_F_OFFLOAD_IP_CKSUM |
VNET_BUFFER_F_OFFLOAD_TCP_CKSUM;
vnet_buffer (b0)->l3_hdr_offset = (u8 *) ih0 - b0->data;
vnet_buffer (b0)->l4_hdr_offset = (u8 *) th0 - b0->data;