]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/ipv4/inet_hashtables.c
[NET] NETNS: Omit namespace comparision without CONFIG_NET_NS.
[mirror_ubuntu-bionic-kernel.git] / net / ipv4 / inet_hashtables.c
index 1064111e5b961f30126b1af93c27ad5baea2dbf6..1b6ff513c75d16b3fd63d362d98bdb71d5f0ad21 100644 (file)
@@ -139,7 +139,7 @@ static struct sock *inet_lookup_listener_slow(struct net *net,
        sk_for_each(sk, node, head) {
                const struct inet_sock *inet = inet_sk(sk);
 
-               if (sock_net(sk) == net && inet->num == hnum &&
+               if (net_eq(sock_net(sk), net) && inet->num == hnum &&
                                !ipv6_only_sock(sk)) {
                        const __be32 rcv_saddr = inet->rcv_saddr;
                        int score = sk->sk_family == PF_INET ? 1 : 0;
@@ -182,7 +182,7 @@ struct sock *__inet_lookup_listener(struct net *net,
                if (inet->num == hnum && !sk->sk_node.next &&
                    (!inet->rcv_saddr || inet->rcv_saddr == daddr) &&
                    (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) &&
-                   !sk->sk_bound_dev_if && sock_net(sk) == net)
+                   !sk->sk_bound_dev_if && net_eq(sock_net(sk), net))
                        goto sherry_cache;
                sk = inet_lookup_listener_slow(net, head, daddr, hnum, dif);
        }