netfilter: nf_nat: generalize IPv4 masquerading support for nf_tables
authorArturo Borrero <arturo.borrero.glez@gmail.com>
Thu, 4 Sep 2014 12:06:33 +0000 (14:06 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 9 Sep 2014 14:31:29 +0000 (16:31 +0200)
commit8dd33cc93ec92b8460ed2ad98c6db39276f6a72b
treefd0e78d1cd7a224aed7e35238525d1ad92af8bd2
parentc55fbbb4a730e3d6e1727b7de08b39e6cd847fad
netfilter: nf_nat: generalize IPv4 masquerading support for nf_tables

Let's refactor the code so we can reach the masquerade functionality
from outside the xt context (ie. nftables).

The patch includes the addition of an atomic counter to the masquerade
notifier: the stuff to be done by the notifier is the same for xt and
nftables. Therefore, only one notification handler is needed.

This factorization only involves IPv4; a similar patch follows to
handle IPv6.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/ipv4/nf_nat_masquerade.h [new file with mode: 0644]
net/ipv4/netfilter/Kconfig
net/ipv4/netfilter/Makefile
net/ipv4/netfilter/ipt_MASQUERADE.c
net/ipv4/netfilter/nf_nat_masquerade_ipv4.c [new file with mode: 0644]