aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/netfilter/ebtables.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-04-11 16:36:42 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-04-12 01:47:50 +0200
commit223fd0adfa8af36d5d9b5d38016e579ee052f367 (patch)
tree6a08e0e189e03375a672078349df260ab955509d /net/bridge/netfilter/ebtables.c
parent971502d77faa50a37c89bc6d172450294ad9a5fd (diff)
downloadlinux-223fd0adfa8af36d5d9b5d38016e579ee052f367.tar.gz
bridge: broute: make broute a real ebtables table
This makes broute a normal ebtables table, hooking at PREROUTING. The broute hook is removed. It uses skb->cb to signal to bridge rx handler that the skb should be routed instead of being bridged. This change is backwards compatible with ebtables as no userspace visible parts are changed. This means we can also remove the !ops test in ebt_register_table, it was only there for broute table sake. Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/bridge/netfilter/ebtables.c')
-rw-r--r--net/bridge/netfilter/ebtables.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index eb15891f8b9ff1..383f0328ff6871 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -1221,10 +1221,6 @@ int ebt_register_table(struct net *net, const struct ebt_table *input_table,
mutex_unlock(&ebt_mutex);
WRITE_ONCE(*res, table);
-
- if (!ops)
- return 0;
-
ret = nf_register_net_hooks(net, ops, hweight32(table->valid_hooks));
if (ret) {
__ebt_unregister_table(net, table);
@@ -1248,8 +1244,7 @@ out:
void ebt_unregister_table(struct net *net, struct ebt_table *table,
const struct nf_hook_ops *ops)
{
- if (ops)
- nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks));
+ nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks));
__ebt_unregister_table(net, table);
}