/* We should have enough space for 40 bytes of options */
ASSERT (tc->snd_mss > 45);
- /* If we use timestamp option, account for it */
+ /* If we use timestamp option, account for it and make sure
+ * the options are 4-byte aligned */
if (tcp_opts_tstamp (&tc->rcv_opts))
- tc->snd_mss -= TCP_OPTION_LEN_TIMESTAMP;
+ tc->snd_mss -= TCP_OPTION_LEN_TIMESTAMP + 2 /* alignment */;
}
/**
tc->iss = tcp_generate_random_iss (tc);
tc->snd_una = tc->iss;
tc->snd_nxt = tc->iss + 1;
- tc->snd_una_max = tc->snd_nxt;
tc->srtt = 0.1 * THZ; /* 100 ms */
if (!tcp_cfg.csum_offload)
vec_reset_length (wrk->pending_deq_acked);
vec_reset_length (wrk->pending_disconnects);
vec_reset_length (wrk->pending_resets);
- wrk->vm = vlib_mains[thread];
+ wrk->vm = vlib_get_main_by_index (thread);
wrk->max_timers_per_loop = 10;
if (thread > 0)
tcp_cfg.max_gso_size = TCP_MAX_GSO_SZ;
/* Time constants defined as timer tick (100us) multiples */
- tcp_cfg.delack_time = 1000; /* 0.1s */
tcp_cfg.closewait_time = 20000; /* 2s */
tcp_cfg.timewait_time = 100000; /* 10s */
tcp_cfg.finwait1_time = 600000; /* 60s */