9p: fix readdir corner cases
[safe/jmp/linux-2.6] / net / netfilter / core.c
index 26b8f48..5bb3473 100644 (file)
@@ -26,7 +26,7 @@
 
 static DEFINE_MUTEX(afinfo_mutex);
 
-const struct nf_afinfo *nf_afinfo[NPROTO] __read_mostly;
+const struct nf_afinfo *nf_afinfo[NFPROTO_NUMPROTO] __read_mostly;
 EXPORT_SYMBOL(nf_afinfo);
 
 int nf_register_afinfo(const struct nf_afinfo *afinfo)
@@ -51,7 +51,7 @@ void nf_unregister_afinfo(const struct nf_afinfo *afinfo)
 }
 EXPORT_SYMBOL_GPL(nf_unregister_afinfo);
 
-struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS] __read_mostly;
+struct list_head nf_hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS] __read_mostly;
 EXPORT_SYMBOL(nf_hooks);
 static DEFINE_MUTEX(nf_hook_mutex);
 
@@ -165,14 +165,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 +174,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 +182,6 @@ next_hook:
                              verdict >> NF_VERDICT_BITS))
                        goto next_hook;
        }
-unlock:
        rcu_read_unlock();
        return ret;
 }
@@ -264,7 +254,7 @@ EXPORT_SYMBOL(proc_net_netfilter);
 void __init netfilter_init(void)
 {
        int i, h;
-       for (i = 0; i < NPROTO; i++) {
+       for (i = 0; i < ARRAY_SIZE(nf_hooks); i++) {
                for (h = 0; h < NF_MAX_HOOKS; h++)
                        INIT_LIST_HEAD(&nf_hooks[i][h]);
        }