diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-11-23 17:29:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-23 17:29:23 -0500 |
commit | 4d0fe50c75a547088e4304e5eb5f521514dfae46 (patch) | |
tree | e1415bc9f01700ee8e0182de1a5550b8d0bf345c /net | |
parent | 15ac2b08a2fd0f4aacbe8ae39788252fea6fbe63 (diff) |
ipv6: tcp: fix tcp_v6_conn_request()
Since linux 2.6.26 (commit c6aefafb7ec6 : Add IPv6 support to TCP SYN
cookies), we can drop a SYN packet reusing a TIME_WAIT socket.
(As a matter of fact we fail to send the SYNACK answer)
As the client resends its SYN packet after a one second timeout, we
accept it, because first packet removed the TIME_WAIT socket before
being dropped.
This probably explains why nobody ever noticed or complained.
Reported-by: Jesse Young <jlyo@jlyo.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 36131d122a6f..2dea4bb7b54a 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1255,6 +1255,13 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1255 | if (!want_cookie || tmp_opt.tstamp_ok) | 1255 | if (!want_cookie || tmp_opt.tstamp_ok) |
1256 | TCP_ECN_create_request(req, tcp_hdr(skb)); | 1256 | TCP_ECN_create_request(req, tcp_hdr(skb)); |
1257 | 1257 | ||
1258 | treq->iif = sk->sk_bound_dev_if; | ||
1259 | |||
1260 | /* So that link locals have meaning */ | ||
1261 | if (!sk->sk_bound_dev_if && | ||
1262 | ipv6_addr_type(&treq->rmt_addr) & IPV6_ADDR_LINKLOCAL) | ||
1263 | treq->iif = inet6_iif(skb); | ||
1264 | |||
1258 | if (!isn) { | 1265 | if (!isn) { |
1259 | struct inet_peer *peer = NULL; | 1266 | struct inet_peer *peer = NULL; |
1260 | 1267 | ||
@@ -1264,12 +1271,6 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1264 | atomic_inc(&skb->users); | 1271 | atomic_inc(&skb->users); |
1265 | treq->pktopts = skb; | 1272 | treq->pktopts = skb; |
1266 | } | 1273 | } |
1267 | treq->iif = sk->sk_bound_dev_if; | ||
1268 | |||
1269 | /* So that link locals have meaning */ | ||
1270 | if (!sk->sk_bound_dev_if && | ||
1271 | ipv6_addr_type(&treq->rmt_addr) & IPV6_ADDR_LINKLOCAL) | ||
1272 | treq->iif = inet6_iif(skb); | ||
1273 | 1274 | ||
1274 | if (want_cookie) { | 1275 | if (want_cookie) { |
1275 | isn = cookie_v6_init_sequence(sk, skb, &req->mss); | 1276 | isn = cookie_v6_init_sequence(sk, skb, &req->mss); |