Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tcp: account for ts offset only if tsecr not zero

We can get SYN with zero tsecr, don't apply offset in this case.

Fixes: ee684b6f2830 ("tcp: send packets with a socket timestamp")
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Alexey Kodanev and committed by
David S. Miller
eee2faab 00355fa5

+2 -1
+2 -1
net/ipv4/tcp_minisocks.c
··· 101 101 tcp_parse_options(skb, &tmp_opt, 0, NULL); 102 102 103 103 if (tmp_opt.saw_tstamp) { 104 - tmp_opt.rcv_tsecr -= tcptw->tw_ts_offset; 104 + if (tmp_opt.rcv_tsecr) 105 + tmp_opt.rcv_tsecr -= tcptw->tw_ts_offset; 105 106 tmp_opt.ts_recent = tcptw->tw_ts_recent; 106 107 tmp_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp; 107 108 paws_reject = tcp_paws_reject(&tmp_opt, th->rst);