netfilter: physdev: relax br_netfilter dependency
authorFlorian Westphal <fw@strlen.de>
Fri, 11 Jan 2019 13:46:15 +0000 (14:46 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 18 Jan 2019 14:02:33 +0000 (15:02 +0100)
commit8e2f311a68494a6677c1724bdcb10bada21af37c
treefc30f35d66252e9177ad60c83157d6c4ae6c40ca
parent827318feb69cb07ed58bb9b9dd6c2eaa81a116ad
netfilter: physdev: relax br_netfilter dependency

Following command:
  iptables -D FORWARD -m physdev ...
causes connectivity loss in some setups.

Reason is that iptables userspace will probe kernel for the module revision
of the physdev patch, and physdev has an artificial dependency on
br_netfilter (xt_physdev use makes no sense unless a br_netfilter module
is loaded).

This causes the "phydev" module to be loaded, which in turn enables the
"call-iptables" infrastructure.

bridged packets might then get dropped by the iptables ruleset.

The better fix would be to change the "call-iptables" defaults to 0 and
enforce explicit setting to 1, but that breaks backwards compatibility.

This does the next best thing: add a request_module call to checkentry.
This was a stray '-D ... -m physdev' won't activate br_netfilter
anymore.

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