[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 18 Feb 2017 12:19:04 +0300
From: Alexey Kodanev <alexey.kodanev@...cle.com>
To: David Miller <davem@...emloft.net>,
Florian Westphal <fw@...len.de>,
Eric Dumazet <edumazet@...gle.com>
Cc: netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH 1/2] tcp: setup random timestamp offset when write_seq
already set
Hi,
On 18.02.2017 3:56, Alexey Kodanev wrote:
> Found that when random offset enabled (default) TCP client can
> still start new connections with and without random offsets. Later,
> if server does active close and re-use sockets in TIME-WAIT state,
> new SYN from client can be rejected on PAWS check inside
> tcp_timewait_state_process().
>
Actually, on second thoughts, we can just copy tsoffset from tw socket:
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 89a95da..f40a61d 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -126,6 +126,7 @@ int tcp_twsk_unique(struct sock *sk, struct sock
*sktw, void *twp)
tp->write_seq = 1;
tp->rx_opt.ts_recent = tcptw->tw_ts_recent;
tp->rx_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp;
+ tp->tsoffset = tcptw->tw_ts_offset;
sock_hold(sktw);
return 1;
}
Will test this and send a new version.
Thanks,
Alexey
Powered by blists - more mailing lists