aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vnet/tcp/tcp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 2f6234562e2..a365cb48f94 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -570,8 +570,15 @@ tcp_init_snd_vars (tcp_connection_t * tc)
{
u32 time_now;
- /* Set random initial sequence */
+ /*
+ * We use the time to randomize iss and for setting up the initial
+ * timestamp. Make sure it's updated otherwise syn and ack in the
+ * handshake may make it look as if time has flown in the opposite
+ * direction for us.
+ */
+ tcp_set_time_now (vlib_get_thread_index ());
time_now = tcp_time_now ();
+
tc->iss = random_u32 (&time_now);
tc->snd_una = tc->iss;
tc->snd_nxt = tc->iss + 1;