netfilter: nf_tables: add nft_dup expression
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 31 May 2015 16:04:11 +0000 (18:04 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 7 Aug 2015 09:49:49 +0000 (11:49 +0200)
commitd877f07112f1e5a247c6b585c971a93895c9f738
tree6ff7fa3d31b94ef6cbe88284d63f93bdab8a35fb
parentbbde9fc1824aab58bc78c084163007dd6c03fe5b
netfilter: nf_tables: add nft_dup expression

This new expression uses the nf_dup engine to clone packets to a given gateway.
Unlike xt_TEE, we use an index to indicate output interface which should be
fine at this stage.

Moreover, change to the preemtion-safe this_cpu_read(nf_skb_duplicated) from
nf_dup_ipv{4,6} to silence a lockdep splat.

Based on the original tee expression from Arturo Borrero Gonzalez, although
this patch has diverted quite a bit from this initial effort due to the
change to support maps.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nft_dup.h [new file with mode: 0644]
include/uapi/linux/netfilter/nf_tables.h
net/ipv4/netfilter/Kconfig
net/ipv4/netfilter/Makefile
net/ipv4/netfilter/nf_dup_ipv4.c
net/ipv4/netfilter/nft_dup_ipv4.c [new file with mode: 0644]
net/ipv6/netfilter/Kconfig
net/ipv6/netfilter/Makefile
net/ipv6/netfilter/nf_dup_ipv6.c
net/ipv6/netfilter/nft_dup_ipv6.c [new file with mode: 0644]