Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: add missing IS_ENABLED(CONFIG_BRIDGE_NETFILTER) checks to header-file.

br_netfilter.h defines inline functions that use an enum constant and
struct member that are only defined if CONFIG_BRIDGE_NETFILTER is
enabled. Added preprocessor checks to ensure br_netfilter.h will
compile if CONFIG_BRIDGE_NETFILTER is disabled.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Jeremy Sowden and committed by
Pablo Neira Ayuso
9211bfbf a1b2f04e

+8
+8
include/net/netfilter/br_netfilter.h
··· 8 8 9 9 static inline struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb) 10 10 { 11 + #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) 11 12 struct nf_bridge_info *b = skb_ext_add(skb, SKB_EXT_BRIDGE_NF); 12 13 13 14 if (b) 14 15 memset(b, 0, sizeof(*b)); 15 16 16 17 return b; 18 + #else 19 + return NULL; 20 + #endif 17 21 } 18 22 19 23 void nf_bridge_update_protocol(struct sk_buff *skb); ··· 42 38 43 39 static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) 44 40 { 41 + #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) 45 42 struct net_bridge_port *port; 46 43 47 44 port = br_port_get_rcu(dev); 48 45 return port ? &port->br->fake_rtable : NULL; 46 + #else 47 + return NULL; 48 + #endif 49 49 } 50 50 51 51 struct net_device *setup_pre_routing(struct sk_buff *skb,