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