X25 fix dead unaccepted sockets
[safe/jmp/linux-2.6] / net / netfilter / core.c
index b16cd79..78b505d 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/inetdevice.h>
 #include <linux/proc_fs.h>
 #include <linux/mutex.h>
+#include <linux/slab.h>
 #include <net/net_namespace.h>
 #include <net/sock.h>
 
@@ -165,14 +166,6 @@ int nf_hook_slow(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
        unsigned int verdict;
        int ret = 0;
 
-#ifdef CONFIG_NET_NS
-       struct net *net;
-
-       net = indev == NULL ? dev_net(outdev) : dev_net(indev);
-       if (net != &init_net)
-               return 1;
-#endif
-
        /* We may already have this, but read-locks nest anyway */
        rcu_read_lock();
 
@@ -182,7 +175,6 @@ next_hook:
                             outdev, &elem, okfn, hook_thresh);
        if (verdict == NF_ACCEPT || verdict == NF_STOP) {
                ret = 1;
-               goto unlock;
        } else if (verdict == NF_DROP) {
                kfree_skb(skb);
                ret = -EPERM;
@@ -191,7 +183,6 @@ next_hook:
                              verdict >> NF_VERDICT_BITS))
                        goto next_hook;
        }
-unlock:
        rcu_read_unlock();
        return ret;
 }
@@ -283,8 +274,8 @@ void __init netfilter_init(void)
 
 #ifdef CONFIG_SYSCTL
 struct ctl_path nf_net_netfilter_sysctl_path[] = {
-       { .procname = "net", .ctl_name = CTL_NET, },
-       { .procname = "netfilter", .ctl_name = NET_NETFILTER, },
+       { .procname = "net", },
+       { .procname = "netfilter", },
        { }
 };
 EXPORT_SYMBOL_GPL(nf_net_netfilter_sysctl_path);