diff options
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 76d52d37d6ac..80007c79f12f 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -137,7 +137,7 @@ static inline int __udp_lib_lport_inuse(struct net *net, __u16 num, | |||
137 | struct hlist_node *node; | 137 | struct hlist_node *node; |
138 | 138 | ||
139 | sk_for_each(sk, node, &udptable[num & (UDP_HTABLE_SIZE - 1)]) | 139 | sk_for_each(sk, node, &udptable[num & (UDP_HTABLE_SIZE - 1)]) |
140 | if (sock_net(sk) == net && sk->sk_hash == num) | 140 | if (net_eq(sock_net(sk), net) && sk->sk_hash == num) |
141 | return 1; | 141 | return 1; |
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
@@ -218,7 +218,7 @@ gotit: | |||
218 | sk_for_each(sk2, node, head) | 218 | sk_for_each(sk2, node, head) |
219 | if (sk2->sk_hash == snum && | 219 | if (sk2->sk_hash == snum && |
220 | sk2 != sk && | 220 | sk2 != sk && |
221 | sock_net(sk2) == net && | 221 | net_eq(sock_net(sk2), net) && |
222 | (!sk2->sk_reuse || !sk->sk_reuse) && | 222 | (!sk2->sk_reuse || !sk->sk_reuse) && |
223 | (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if | 223 | (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if |
224 | || sk2->sk_bound_dev_if == sk->sk_bound_dev_if) && | 224 | || sk2->sk_bound_dev_if == sk->sk_bound_dev_if) && |
@@ -269,7 +269,7 @@ static struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr, | |||
269 | sk_for_each(sk, node, &udptable[hnum & (UDP_HTABLE_SIZE - 1)]) { | 269 | sk_for_each(sk, node, &udptable[hnum & (UDP_HTABLE_SIZE - 1)]) { |
270 | struct inet_sock *inet = inet_sk(sk); | 270 | struct inet_sock *inet = inet_sk(sk); |
271 | 271 | ||
272 | if (sock_net(sk) == net && sk->sk_hash == hnum && | 272 | if (net_eq(sock_net(sk), net) && sk->sk_hash == hnum && |
273 | !ipv6_only_sock(sk)) { | 273 | !ipv6_only_sock(sk)) { |
274 | int score = (sk->sk_family == PF_INET ? 1 : 0); | 274 | int score = (sk->sk_family == PF_INET ? 1 : 0); |
275 | if (inet->rcv_saddr) { | 275 | if (inet->rcv_saddr) { |
@@ -1511,7 +1511,7 @@ static struct sock *udp_get_first(struct seq_file *seq) | |||
1511 | for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) { | 1511 | for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) { |
1512 | struct hlist_node *node; | 1512 | struct hlist_node *node; |
1513 | sk_for_each(sk, node, state->hashtable + state->bucket) { | 1513 | sk_for_each(sk, node, state->hashtable + state->bucket) { |
1514 | if (sock_net(sk) != net) | 1514 | if (!net_eq(sock_net(sk), net)) |
1515 | continue; | 1515 | continue; |
1516 | if (sk->sk_family == state->family) | 1516 | if (sk->sk_family == state->family) |
1517 | goto found; | 1517 | goto found; |
@@ -1531,7 +1531,7 @@ static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk) | |||
1531 | sk = sk_next(sk); | 1531 | sk = sk_next(sk); |
1532 | try_again: | 1532 | try_again: |
1533 | ; | 1533 | ; |
1534 | } while (sk && (sock_net(sk) != net || sk->sk_family != state->family)); | 1534 | } while (sk && (!net_eq(sock_net(sk), net) || sk->sk_family != state->family)); |
1535 | 1535 | ||
1536 | if (!sk && ++state->bucket < UDP_HTABLE_SIZE) { | 1536 | if (!sk && ++state->bucket < UDP_HTABLE_SIZE) { |
1537 | sk = sk_head(state->hashtable + state->bucket); | 1537 | sk = sk_head(state->hashtable + state->bucket); |