inet6_hashtables.c (39d8cda76cfb1178455f9d196b39e773878e6c05) inet6_hashtables.c (3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Generic INET6 transport hashtables
7 *
8 * Authors: Lotsa people, from code originally in tcp, generalised here

--- 91 unchanged lines hidden (view full) ---

100{
101 struct sock *sk;
102 const struct hlist_node *node;
103 struct sock *result = NULL;
104 int score, hiscore = 0;
105
106 read_lock(&hashinfo->lhash_lock);
107 sk_for_each(sk, node, &hashinfo->listening_hash[inet_lhashfn(hnum)]) {
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Generic INET6 transport hashtables
7 *
8 * Authors: Lotsa people, from code originally in tcp, generalised here

--- 91 unchanged lines hidden (view full) ---

100{
101 struct sock *sk;
102 const struct hlist_node *node;
103 struct sock *result = NULL;
104 int score, hiscore = 0;
105
106 read_lock(&hashinfo->lhash_lock);
107 sk_for_each(sk, node, &hashinfo->listening_hash[inet_lhashfn(hnum)]) {
108 if (sk->sk_net == net && inet_sk(sk)->num == hnum &&
108 if (sock_net(sk) == net && inet_sk(sk)->num == hnum &&
109 sk->sk_family == PF_INET6) {
110 const struct ipv6_pinfo *np = inet6_sk(sk);
111
112 score = 1;
113 if (!ipv6_addr_any(&np->rcv_saddr)) {
114 if (!ipv6_addr_equal(&np->rcv_saddr, daddr))
115 continue;
116 score++;

--- 50 unchanged lines hidden (view full) ---

167 const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport);
168 const unsigned int hash = inet6_ehashfn(daddr, lport, saddr,
169 inet->dport);
170 struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash);
171 rwlock_t *lock = inet_ehash_lockp(hinfo, hash);
172 struct sock *sk2;
173 const struct hlist_node *node;
174 struct inet_timewait_sock *tw;
109 sk->sk_family == PF_INET6) {
110 const struct ipv6_pinfo *np = inet6_sk(sk);
111
112 score = 1;
113 if (!ipv6_addr_any(&np->rcv_saddr)) {
114 if (!ipv6_addr_equal(&np->rcv_saddr, daddr))
115 continue;
116 score++;

--- 50 unchanged lines hidden (view full) ---

167 const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport);
168 const unsigned int hash = inet6_ehashfn(daddr, lport, saddr,
169 inet->dport);
170 struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash);
171 rwlock_t *lock = inet_ehash_lockp(hinfo, hash);
172 struct sock *sk2;
173 const struct hlist_node *node;
174 struct inet_timewait_sock *tw;
175 struct net *net = sk->sk_net;
175 struct net *net = sock_net(sk);
176
177 prefetch(head->chain.first);
178 write_lock(lock);
179
180 /* Check TIME-WAIT sockets first. */
181 sk_for_each(sk2, node, &head->twchain) {
182 tw = inet_twsk(sk2);
183

--- 60 unchanged lines hidden ---
176
177 prefetch(head->chain.first);
178 write_lock(lock);
179
180 /* Check TIME-WAIT sockets first. */
181 sk_for_each(sk2, node, &head->twchain) {
182 tw = inet_twsk(sk2);
183

--- 60 unchanged lines hidden ---