netfilter: meta: add support for setting skb->pkttype
commitb4aae759c22e71a3c32144f0b3bc4f2fa4aaae98
authorFlorian Westphal <fw@strlen.de>
Thu, 10 Dec 2015 17:04:07 +0000 (10 18:04 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 18 Dec 2015 13:12:56 +0000 (18 14:12 +0100)
treeb45a5994f419f696c3dbd3bde26a74a1ee7845e6
parent9c55d3b5459bffe8ac098175e672a90260c0cfa4
netfilter: meta: add support for setting skb->pkttype

This allows to redirect bridged packets to local machine:

ether type ip ether daddr set aa:53:08:12:34:56 meta pkttype set unicast
Without 'set unicast', ip stack discards PACKET_OTHERHOST skbs.

It is also useful to add support for a '-m cluster like' nft rule
(where switch floods packets to several nodes, and each cluster node
 node processes a subset of packets for load distribution).

Mangling is restricted to HOST/OTHER/BROAD/MULTICAST, i.e. you cannot set
skb->pkt_type to PACKET_KERNEL or change PACKET_LOOPBACK to PACKET_HOST.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_meta.c