From cf1f2c4f867377e9294676e8a8f84cabb430c63f Mon Sep 17 00:00:00 2001 From: curuwang Date: Wed, 21 Dec 2022 23:51:40 +0800 Subject: [PATCH] tcp: initialize sysctl_tcp_wan_timestamps to 1 by default. when sysctl_tcp_timestamps = 1 and tcp_wan_timestamps = 0, client's SYN packet will contain tcp timestamp option, but other segment not, which violate RFC 7323, which states: " Once TSopt has been successfully negotiated, that is both and contain TSopt, the TSopt MUST be sent in every non- segment for the duration of the connection" also, this will break peer server with syn cookie activated, make it clear window scale and timestamp option, causing poor transmit performance. Signed-off-by: curuwang --- net/ipv4/tcp_ipv4.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 6585e113cd24..6aca996338fe 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -3241,6 +3241,7 @@ static int __net_init tcp_sk_init(struct net *net) net->ipv4.sysctl_tcp_sack = 1; net->ipv4.sysctl_tcp_window_scaling = 1; net->ipv4.sysctl_tcp_timestamps = 1; + net->ipv4.sysctl_tcp_wan_timestamps = 1; net->ipv4.sysctl_tcp_early_retrans = 3; net->ipv4.sysctl_tcp_recovery = TCP_RACK_LOSS_DETECTION; net->ipv4.sysctl_tcp_slow_start_after_idle = 1; /* By default, RFC2861 behavior. */