]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.20.2/ipv6-hashtables-use-appropriate-seed-for-caluculating-ehash-index.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.20.2 / ipv6-hashtables-use-appropriate-seed-for-caluculating-ehash-index.patch
1 From stable-bounces@linux.kernel.org Mon Feb 12 16:50:02 2007
2 From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
3 Date: Tue, 13 Feb 2007 09:48:41 +0900 (JST)
4 Subject: IPV6: HASHTABLES: Use appropriate seed for caluculating ehash index.
5 To: davem@davemloft.net
6 Cc: yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, handat@pm.nttdata.co.jp, stable@kernel.org
7 Message-ID: <20070213.094841.17517365.yoshfuji@linux-ipv6.org>
8
9 From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
10
11 Tetsuo Handa <handat@pm.nttdata.co.jp> told me that connect(2) with TCPv6
12 socket almost always took a few minutes to return when we did not have any
13 ports available in the range of net.ipv4.ip_local_port_range.
14
15 The reason was that we used incorrect seed for calculating index of
16 hash when we check established sockets in __inet6_check_established().
17
18 Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
19 Signed-off-by: David S. Miller <davem@davemloft.net>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
21
22 ---
23 net/ipv6/inet6_hashtables.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26 --- linux-2.6.20.1.orig/net/ipv6/inet6_hashtables.c
27 +++ linux-2.6.20.1/net/ipv6/inet6_hashtables.c
28 @@ -172,7 +172,7 @@ static int __inet6_check_established(str
29 const struct in6_addr *saddr = &np->daddr;
30 const int dif = sk->sk_bound_dev_if;
31 const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport);
32 - const unsigned int hash = inet6_ehashfn(daddr, inet->num, saddr,
33 + const unsigned int hash = inet6_ehashfn(daddr, lport, saddr,
34 inet->dport);
35 struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash);
36 struct sock *sk2;