aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/inet6_hashtables.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/inet6_hashtables.c')
-rw-r--r--net/ipv6/inet6_hashtables.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index ed5787b20192..b86b429f5f81 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -42,42 +42,6 @@ u32 inet6_ehashfn(const struct net *net,
42 inet6_ehash_secret + net_hash_mix(net)); 42 inet6_ehash_secret + net_hash_mix(net));
43} 43}
44 44
45int __inet6_hash(struct sock *sk, struct inet_timewait_sock *tw)
46{
47 struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo;
48 int twrefcnt = 0;
49
50 WARN_ON(!sk_unhashed(sk));
51
52 if (sk->sk_state == TCP_LISTEN) {
53 struct inet_listen_hashbucket *ilb;
54
55 ilb = &hashinfo->listening_hash[inet_sk_listen_hashfn(sk)];
56 spin_lock(&ilb->lock);
57 __sk_nulls_add_node_rcu(sk, &ilb->head);
58 spin_unlock(&ilb->lock);
59 } else {
60 unsigned int hash;
61 struct hlist_nulls_head *list;
62 spinlock_t *lock;
63
64 sk->sk_hash = hash = sk_ehashfn(sk);
65 list = &inet_ehash_bucket(hashinfo, hash)->chain;
66 lock = inet_ehash_lockp(hashinfo, hash);
67 spin_lock(lock);
68 __sk_nulls_add_node_rcu(sk, list);
69 if (tw) {
70 WARN_ON(sk->sk_hash != tw->tw_hash);
71 twrefcnt = inet_twsk_unhash(tw);
72 }
73 spin_unlock(lock);
74 }
75
76 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
77 return twrefcnt;
78}
79EXPORT_SYMBOL(__inet6_hash);
80
81/* 45/*
82 * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so 46 * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so
83 * we need not check it for TCP lookups anymore, thanks Alexey. -DaveM 47 * we need not check it for TCP lookups anymore, thanks Alexey. -DaveM
@@ -306,6 +270,6 @@ int inet6_hash_connect(struct inet_timewait_death_row *death_row,
306 struct sock *sk) 270 struct sock *sk)
307{ 271{
308 return __inet_hash_connect(death_row, sk, inet6_sk_port_offset(sk), 272 return __inet_hash_connect(death_row, sk, inet6_sk_port_offset(sk),
309 __inet6_check_established, __inet6_hash); 273 __inet6_check_established, __inet_hash_nolisten);
310} 274}
311EXPORT_SYMBOL_GPL(inet6_hash_connect); 275EXPORT_SYMBOL_GPL(inet6_hash_connect);