]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
netfilter: bridge: don't use nf_bridge_info data to store mac header
authorFlorian Westphal <fw@strlen.de>
Thu, 2 Apr 2015 12:31:40 +0000 (14:31 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 8 Apr 2015 14:49:07 +0000 (16:49 +0200)
commite70deecbf8e1562cac0b19f23848919e2f5d65aa
tree9350ff40e25b7a7a3c096b5463441d7782c750de
parentd64d80a2cde94f3e89caebd27240be419fec5b81
netfilter: bridge: don't use nf_bridge_info data to store mac header

br_netfilter maintains an extra state, nf_bridge_info, which is attached
to skb via skb->nf_bridge pointer.

Amongst other things we use skb->nf_bridge->data to store the original
mac header for every processed skb.

This is required for ip refragmentation when using conntrack
on top of bridge, because ip_fragment doesn't copy it from original skb.

However there is no need anymore to do this unconditionally.

Move this to the one place where its needed -- when br_netfilter calls
ip_fragment().

Also switch to percpu storage for this so we can handle fragmenting
without accessing nf_bridge meta data.

Only user left is neigh resolution when DNAT is detected, to hold
the original source mac address (neigh resolution builds new mac header
using bridge mac), so rename ->data and reduce its size to whats needed.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/skbuff.h
net/bridge/br_netfilter.c