[PATCH nf-next] netfilter: avoid arp/bridge WARN_ON if arp/ebtables not supported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <fw@xxxxxxxxx>
---
 include/linux/netfilter.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 84987186aa26..85a1a0b32c66 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -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]);
-- 
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux