|
@@ -23,11 +23,9 @@
|
|
#include <net/secure_seq.h>
|
|
#include <net/secure_seq.h>
|
|
#include <net/ip.h>
|
|
#include <net/ip.h>
|
|
|
|
|
|
-static u32 inet6_ehashfn(const struct net *net,
|
|
|
|
- const struct in6_addr *laddr,
|
|
|
|
- const u16 lport,
|
|
|
|
- const struct in6_addr *faddr,
|
|
|
|
- const __be16 fport)
|
|
|
|
|
|
+u32 inet6_ehashfn(const struct net *net,
|
|
|
|
+ const struct in6_addr *laddr, const u16 lport,
|
|
|
|
+ const struct in6_addr *faddr, const __be16 fport)
|
|
{
|
|
{
|
|
static u32 inet6_ehash_secret __read_mostly;
|
|
static u32 inet6_ehash_secret __read_mostly;
|
|
static u32 ipv6_hash_secret __read_mostly;
|
|
static u32 ipv6_hash_secret __read_mostly;
|
|
@@ -44,18 +42,6 @@ static u32 inet6_ehashfn(const struct net *net,
|
|
inet6_ehash_secret + net_hash_mix(net));
|
|
inet6_ehash_secret + net_hash_mix(net));
|
|
}
|
|
}
|
|
|
|
|
|
-static int inet6_sk_ehashfn(const struct sock *sk)
|
|
|
|
-{
|
|
|
|
- const struct inet_sock *inet = inet_sk(sk);
|
|
|
|
- const struct in6_addr *laddr = &sk->sk_v6_rcv_saddr;
|
|
|
|
- const struct in6_addr *faddr = &sk->sk_v6_daddr;
|
|
|
|
- const __u16 lport = inet->inet_num;
|
|
|
|
- const __be16 fport = inet->inet_dport;
|
|
|
|
- struct net *net = sock_net(sk);
|
|
|
|
-
|
|
|
|
- return inet6_ehashfn(net, laddr, lport, faddr, fport);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
int __inet6_hash(struct sock *sk, struct inet_timewait_sock *tw)
|
|
int __inet6_hash(struct sock *sk, struct inet_timewait_sock *tw)
|
|
{
|
|
{
|
|
struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo;
|
|
struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo;
|
|
@@ -75,7 +61,7 @@ int __inet6_hash(struct sock *sk, struct inet_timewait_sock *tw)
|
|
struct hlist_nulls_head *list;
|
|
struct hlist_nulls_head *list;
|
|
spinlock_t *lock;
|
|
spinlock_t *lock;
|
|
|
|
|
|
- sk->sk_hash = hash = inet6_sk_ehashfn(sk);
|
|
|
|
|
|
+ sk->sk_hash = hash = sk_ehashfn(sk);
|
|
list = &inet_ehash_bucket(hashinfo, hash)->chain;
|
|
list = &inet_ehash_bucket(hashinfo, hash)->chain;
|
|
lock = inet_ehash_lockp(hashinfo, hash);
|
|
lock = inet_ehash_lockp(hashinfo, hash);
|
|
spin_lock(lock);
|
|
spin_lock(lock);
|