]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: ebtables: remove the 3 ebtables pointers from struct net
authorFlorian Westphal <fw@strlen.de>
Wed, 21 Apr 2021 07:50:59 +0000 (09:50 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 26 Apr 2021 01:20:07 +0000 (03:20 +0200)
commiteb43b64d32bbdbeec3d3bec94aea1fd6b7ce7cb2
treed568105e360c30397fcc498d11fc1373d71dc7ce
parent9d09fa1d045d469e880e143b87b1fb8a827b424a
netfilter: ebtables: remove the 3 ebtables pointers from struct net

ebtables stores the table internal data (what gets passed to the
ebt_do_table() interpreter) in struct net.

nftables keeps the internal interpreter format in pernet lists
and passes it via the netfilter core infrastructure (priv pointer).

Do the same for ebtables: the nf_hook_ops are duplicated via kmemdup,
then the ops->priv pointer is set to the table that is being registered.

After that, the netfilter core passes this table info to the hookfn.

This allows to remove the pointers from struct net.

Same pattern can be applied to ip/ip6/arptables.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter_bridge/ebtables.h
include/net/netns/x_tables.h
net/bridge/netfilter/ebtable_broute.c
net/bridge/netfilter/ebtable_filter.c
net/bridge/netfilter/ebtable_nat.c
net/bridge/netfilter/ebtables.c