Merge tag 'mmc-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
[linux-2.6-microblaze.git] / net / netfilter / xt_socket.c
index 5c0779c..0472f34 100644 (file)
@@ -56,8 +56,12 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par,
        struct sk_buff *pskb = (struct sk_buff *)skb;
        struct sock *sk = skb->sk;
 
+       if (!net_eq(xt_net(par), sock_net(sk)))
+               sk = NULL;
+
        if (!sk)
                sk = nf_sk_lookup_slow_v4(xt_net(par), skb, xt_in(par));
+
        if (sk) {
                bool wildcard;
                bool transparent = true;
@@ -113,8 +117,12 @@ socket_mt6_v1_v2_v3(const struct sk_buff *skb, struct xt_action_param *par)
        struct sk_buff *pskb = (struct sk_buff *)skb;
        struct sock *sk = skb->sk;
 
+       if (!net_eq(xt_net(par), sock_net(sk)))
+               sk = NULL;
+
        if (!sk)
                sk = nf_sk_lookup_slow_v6(xt_net(par), skb, xt_in(par));
+
        if (sk) {
                bool wildcard;
                bool transparent = true;