diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-06-16 20:13:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-16 20:13:27 -0400 |
commit | 9f26b3add3783c0af869ea2207871da5dafefffa (patch) | |
tree | adadfc84d2daf5133c0c536d87242df049daf53e /include/net/inet_sock.h | |
parent | 2086a65078bd24682bdcf413d9c91d81988b8359 (diff) |
inet: add struct net argument to inet_ehashfn
Although this hash takes addresses into account, the ehash chains
can also be too long when, for instance, communications via lo occur.
So, prepare the inet_hashfn to take struct net into account.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inet_sock.h')
-rw-r--r-- | include/net/inet_sock.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 9fabe5b38912..85bb420c5d86 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -171,7 +171,8 @@ extern int inet_sk_rebuild_header(struct sock *sk); | |||
171 | extern u32 inet_ehash_secret; | 171 | extern u32 inet_ehash_secret; |
172 | extern void build_ehash_secret(void); | 172 | extern void build_ehash_secret(void); |
173 | 173 | ||
174 | static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport, | 174 | static inline unsigned int inet_ehashfn(struct net *net, |
175 | const __be32 laddr, const __u16 lport, | ||
175 | const __be32 faddr, const __be16 fport) | 176 | const __be32 faddr, const __be16 fport) |
176 | { | 177 | { |
177 | return jhash_3words((__force __u32) laddr, | 178 | return jhash_3words((__force __u32) laddr, |
@@ -187,8 +188,9 @@ static inline int inet_sk_ehashfn(const struct sock *sk) | |||
187 | const __u16 lport = inet->num; | 188 | const __u16 lport = inet->num; |
188 | const __be32 faddr = inet->daddr; | 189 | const __be32 faddr = inet->daddr; |
189 | const __be16 fport = inet->dport; | 190 | const __be16 fport = inet->dport; |
191 | struct net *net = sock_net(sk); | ||
190 | 192 | ||
191 | return inet_ehashfn(laddr, lport, faddr, fport); | 193 | return inet_ehashfn(net, laddr, lport, faddr, fport); |
192 | } | 194 | } |
193 | 195 | ||
194 | 196 | ||