]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[NETNS]: Process netfilter hooks in initial namespace only.
authorDenis V. Lunev <den@openvz.org>
Mon, 24 Mar 2008 22:32:09 +0000 (15:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Mar 2008 22:32:09 +0000 (15:32 -0700)
There were no packets in the namespace other than initial
previously. This will be changed in the neareast future. Netfilters
are not namespace aware and should be processed in the initial
namespace only for now.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/core.c

index c4065b8f9a95f6abb66242a3c3a9f8a7990da552..ec05684c56d709aa226642cba6d5330efab41d82 100644 (file)
@@ -165,6 +165,14 @@ int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
        unsigned int verdict;
        int ret = 0;
 
+#ifdef CONFIG_NET_NS
+       struct net *net;
+
+       net = indev == NULL ? outdev->nd_net : indev->nd_net;
+       if (net != &init_net)
+               return 1;
+#endif
+
        /* We may already have this, but read-locks nest anyway */
        rcu_read_lock();