Skip to content

netfilter: nat: add inet family nat support

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6netfilter: nat: add inet family nat supportinclude/net/netfilter/nf_nat.h net/netfilter/nf_nat_core.c net/netfilter/nf_nat_proto.c +2 more+141 -190 replies
2/6netfilter: nf_tables: merge route type into coreinclude/linux/netfilter_ipv6.h include/net/netfilter/nf_tables.h net/ipv4/netfilter/Kconfig +9 more+191 -2140 replies
3/6netfilter: replace NF_NAT_NEEDED with IS_ENABLED(CONFIG_NF_NAT)include/linux/netfilter.h include/net/netfilter/nf_conntrack_expect.h net/netfilter/Kconfig +4 more+21 -260 replies
4/6netfilter: nft_masq: add inet supportnet/netfilter/nft_masq.c+64 -00 replies
5/6netfilter: nft_redir: add inet supportnet/netfilter/nft_redir.c+61 -00 replies
6/6kselftests: extend nft_nat with inet family based nat hookstools/testing/selftests/netfilter/nft_nat.sh+94 -360 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH nf-next 0/6] netfilter: nat: add inet family nat support

This series adds support for the nat chain type in the inet family.

Example:

table inet nat {
	chain postrouting {
		type nat hook output priority 0; policy accept;
		ip6 daddr dead:1::99 snat ip6 to dead:2::99
		meta oifname "ppp+" masquerade
	}
}

This avoids the need to create both ip and ip6 nat tables for the masquerade rule.

Florian Westphal (6):
netfilter: nat: add inet family nat support
netfilter: nf_tables: merge route type into core
netfilter: replace NF_NAT_NEEDED with IS_ENABLED(CONFIG_NF_NAT)
netfilter: nft_masq: add inet support
netfilter: nft_redir: add inet support
kselftests: extend nft_nat with inet family based nat hooks

 include/linux/netfilter.h                    |    2 
 include/linux/netfilter_ipv6.h               |   15 ++
 include/net/netfilter/nf_conntrack_expect.h  |    2 
 include/net/netfilter/nf_nat.h               |    7 -
 include/net/netfilter/nf_tables.h            |    2 
 net/ipv4/netfilter/Kconfig                   |    8 -
 net/ipv4/netfilter/Makefile                  |    1 
 net/ipv6/netfilter/Kconfig                   |    8 -
 net/ipv6/netfilter/Makefile                  |    1 
 net/netfilter/Kconfig                        |    5 
 net/netfilter/Makefile                       |    3 
 net/netfilter/nf_conntrack_expect.c          |    2 
 net/netfilter/nf_conntrack_netlink.c         |   16 +-
 net/netfilter/nf_conntrack_sip.c             |    2 
 net/netfilter/nf_nat_core.c                  |   16 +-
 net/netfilter/nf_nat_proto.c                 |   59 +++++---
 net/netfilter/nf_tables_api.c                |    2 
 net/netfilter/nft_chain_nat.c                |   36 +++++
 net/netfilter/nft_chain_route.c              |  169 +++++++++++++++++++++++++
 net/netfilter/nft_masq.c                     |   64 +++++++++
 net/netfilter/nft_nat.c                      |   58 ++++++++
 net/netfilter/nft_redir.c                    |   61 +++++++++
 net/openvswitch/conntrack.c                  |   18 +-
 tools/testing/selftests/netfilter/nft_nat.sh |  130 +++++++++++++------
 net/ipv4/netfilter/nft_chain_route_ipv4.c    |   89 -------------
 net/ipv6/netfilter/nft_chain_route_ipv6.c    |   91 -------------
 26 files changed, 572 insertions(+), 295 deletions(-)