netns netfilter: per-netns FILTER, MANGLE, RAW
Subsystems (3)
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
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 removeinit_netchecks innf_sockopt.candinet_create()
to see the effect.
Also applied, thanks.