Skip to content

Commit

Permalink
[NETNS]: Process netfilter hooks in initial namespace only.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Mar 24, 2008
1 parent 05cf89d commit 0be43f8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/netfilter/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 0be43f8

Please sign in to comment.