session: first approximation implementation of tls
[vpp.git] / src / vnet / tcp / tcp_output.c
index f377c91..bbcbc91 100644 (file)
@@ -389,7 +389,7 @@ tcp_make_options (tcp_connection_t * tc, tcp_options_t * opts,
     case TCP_STATE_SYN_SENT:
       return tcp_make_syn_options (opts, tc->rcv_wscale);
     default:
-      clib_warning ("Not handled!");
+      clib_warning ("State not handled! %d", state);
       return 0;
     }
 }
@@ -503,7 +503,7 @@ always_inline void *
 tcp_init_buffer (vlib_main_t * vm, vlib_buffer_t * b)
 {
   ASSERT ((b->flags & VLIB_BUFFER_NEXT_PRESENT) == 0);
-  b->flags &= VLIB_BUFFER_FREE_LIST_INDEX_MASK;
+  b->flags &= VLIB_BUFFER_NON_DEFAULT_FREELIST;
   b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
   b->total_length_not_including_first_buffer = 0;
   vnet_buffer (b)->tcp.flags = 0;
@@ -1299,7 +1299,7 @@ tcp_prepare_retransmit_segment (tcp_connection_t * tc, u32 offset,
          ASSERT (n_peeked == len_to_deq);
          n_bytes += n_peeked;
          chain_b->current_length = n_peeked;
-         chain_b->flags &= VLIB_BUFFER_FREE_LIST_INDEX_MASK;
+         chain_b->flags &= VLIB_BUFFER_NON_DEFAULT_FREELIST;
          chain_b->next_buffer = 0;
 
          /* update previous buffer */
@@ -1376,7 +1376,7 @@ tcp_timer_retransmit_handler_i (u32 index, u8 is_syn)
   if (tc->state >= TCP_STATE_ESTABLISHED)
     {
       /* Lost FIN, retransmit and return */
-      if (tc->state == TCP_STATE_FIN_WAIT_1)
+      if (tcp_is_lost_fin (tc))
        {
          tcp_send_fin (tc);
          tc->rto_boff += 1;
@@ -1495,8 +1495,6 @@ tcp_timer_retransmit_handler_i (u32 index, u8 is_syn)
   else
     {
       ASSERT (tc->state == TCP_STATE_CLOSED);
-      if (CLIB_DEBUG)
-       TCP_DBG ("connection state: %U", format_tcp_connection, tc, 2);
       return;
     }
 }
@@ -1975,6 +1973,7 @@ tcp_push_header (transport_connection_t * tconn, vlib_buffer_t * b)
       tc->rtt_ts = tcp_time_now ();
       tc->rtt_seq = tc->snd_nxt;
     }
+  tcp_trajectory_add_start (b, 3);
   return 0;
 }