netfilter: avoid arp/bridge WARN_ON if arp/ebtables not supported
Florian Westphal
maintainerPATCH 1/1 netfilter: avoid arp/bridge WARN_ON if arp/ebtables not supported
We need to retain the 'case' statement, otherwise, if e.g. arp tables isn't supported first NF_HOOK(NFPROTO_ARP, ... will produce a bogus WARN_ON().
Fixes 8de98f05836 ("netfilter: don't allocate space for arp/bridge hooks unless needed")
Signed-off-by Florian Westphal <[email protected]>
--- include/linux/netfilter.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/netfilter.h +4 -4
@@ -214,16 +214,16 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct net *net,case NFPROTO_IPV6 : hook_head =rcu_dereference (net->nf.hooks_ipv6[hook]);break ; -#ifdef CONFIG_NETFILTER_FAMILY_ARP case NFPROTO_ARP : +#ifdef CONFIG_NETFILTER_FAMILY_ARP hook_head =rcu_dereference (net->nf.hooks_arp[hook]); -break ;#endif -#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE +break ;case NFPROTO_BRIDGE : +#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE hook_head =rcu_dereference (net->nf.hooks_bridge[hook]); -break ;#endif +break ;#if IS_ENABLED (CONFIG_DECNET )case NFPROTO_DECNET : hook_head =rcu_dereference (net->nf.hooks_decnet[hook]);
Signature · 1 line
2.13.6
Quoted 3 lines · Florian Westphal
We need to retain the 'case' statement, otherwise, if e.g. arp tables isn't supported first NF_HOOK(NFPROTO_ARP, ... will produce a bogus
WARN_ON().
Applied, thanks Florian.