Skip to content

Commit eee2faa

Browse files
akodanevdavem330
authored andcommitted
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: ee684b6 ("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>
1 parent 00355fa commit eee2faa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/tcp_minisocks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb,
101101
tcp_parse_options(skb, &tmp_opt, 0, NULL);
102102

103103
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;
105106
tmp_opt.ts_recent = tcptw->tw_ts_recent;
106107
tmp_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp;
107108
paws_reject = tcp_paws_reject(&tmp_opt, th->rst);

0 commit comments

Comments
 (0)