diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-12-16 17:08:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-16 17:08:34 -0500 |
commit | bc2ce894e113ed95b92541134b002fdc641e8080 (patch) | |
tree | 7c427099d5a1ab9cd387861e79470fc200153ff8 /include/net/tcp.h | |
parent | 443457242beb6716b43db4d62fe148eab5515505 (diff) |
tcp: relax tcp_paws_check()
Some windows versions have wrong RFC1323 implementations, with SYN and
SYNACKS messages containing zero tcp timestamps.
We relaxed in commit fc1ad92dfc4e363 the passive connection case
(Windows connects to a linux machine), but the reverse case (linux
connects to a Windows machine) has an analogue problem when tsvals from
windows machine are 'negative' (high order bit set) : PAWS triggers and
we drops incoming messages.
Fix this by making zero ts_recent value special, allowing frame to be
processed.
Based on a report and initial patch from Dmitiy Balakin
Bugzilla reference : https://bugzilla.kernel.org/show_bug.cgi?id=24842
Reported-by: dmitriy.balakin@nicneiron.ru
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 3f227baee4be..2ab6c9c1c53a 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1038,7 +1038,13 @@ static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, | |||
1038 | return 1; | 1038 | return 1; |
1039 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) | 1039 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) |
1040 | return 1; | 1040 | return 1; |
1041 | 1041 | /* | |
1042 | * Some OSes send SYN and SYNACK messages with tsval=0 tsecr=0, | ||
1043 | * then following tcp messages have valid values. Ignore 0 value, | ||
1044 | * or else 'negative' tsval might forbid us to accept their packets. | ||
1045 | */ | ||
1046 | if (!rx_opt->ts_recent) | ||
1047 | return 1; | ||
1042 | return 0; | 1048 | return 0; |
1043 | } | 1049 | } |
1044 | 1050 | ||