Skip to contentSkip to conversation

netns netfilter: per-netns FILTER, MANGLE, RAW

PATCH Applied Alexey Dobriyan 2 participants 2 messages Jan 21, 2008 – Jan 22, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 5/5 netns netfilter: per-netns FILTER, MANGLE, RAW

Now, iptables show and configure different set of rules in different netnss'. Filtering decisions are still made by consulting only init_net's set.

Changes are identical except naming so no splitting.

P.S.: one need to remove init_net checks in nf_sockopt.c and inet_create()
to see the effect.

---

 include/net/netns/ipv4.h            |    5 ++++
 net/ipv4/netfilter/iptable_filter.c |   41 ++++++++++++++++++++++++-----------
 net/ipv4/netfilter/iptable_mangle.c |   41 ++++++++++++++++++++++++-----------
 net/ipv4/netfilter/iptable_raw.c    |   41 ++++++++++++++++++++++++-----------
 4 files changed, 92 insertions(+), 36 deletions(-)
include/net/netns/ipv4.h +5 -0
@@ -22,5 +22,10 @@ struct netns_ipv4 {
 #endif
 	struct hlist_head	*fib_table_hash;
 	struct sock		*fibnl;
+#ifdef CONFIG_NETFILTER
+	struct xt_table		*iptable_filter;
+	struct xt_table		*iptable_mangle;
+	struct xt_table		*iptable_raw;
+#endif
 };
 #endif
net/ipv4/netfilter/iptable_filter.c +29 -12

95 lines not on this page · raw message

net/ipv4/netfilter/iptable_mangle.c +29 -12

93 lines not on this page · raw message

net/ipv4/netfilter/iptable_raw.c +29 -12

93 lines not on this page · raw message

#1 lore raw
Quoted 8 lines · Alexey Dobriyan

Now, iptables show and configure different set of rules in different netnss'. Filtering decisions are still made by consulting only init_net's set.

Changes are identical except naming so no splitting.

P.S.: one need to remove init_net checks in nf_sockopt.c and inet_create()
to see the effect.

Also applied, thanks.