History

netfilter: bridge: make NF_TABLES_BRIDGE tristate

The new nft_meta_bridge code fails to link as built-in when NF_TABLES is a loadable module. net/bridge/netfilter/nft_meta_bridge.o: In function `nft_meta_bridge_get_eval': nft_meta_bridge.c:(.text+0x1e8): undefined reference to `nft_meta_get_eval' net/bridge/netfilter/nft_meta_bridge.o: In function `nft_meta_bridge_get_init': nft_meta_bridge.c:(.text+0x468): undefined reference to `nft_meta_get_init' nft_meta_bridge.c:(.text+0x49c): undefined reference to `nft_parse_register' nft_meta_bridge.c:(.text+0x4cc): undefined reference to `nft_validate_register_store' net/bridge/netfilter/nft_meta_bridge.o: In function `nft_meta_bridge_module_exit': nft_meta_bridge.c:(.exit.text+0x14): undefined reference to `nft_unregister_expr' net/bridge/netfilter/nft_meta_bridge.o: In function `nft_meta_bridge_module_init': nft_meta_bridge.c:(.init.text+0x14): undefined reference to `nft_register_expr' net/bridge/netfilter/nft_meta_bridge.o:(.rodata+0x60): undefined reference to `nft_meta_get_dump' net/bridge/netfilter/nft_meta_bridge.o:(.rodata+0x88): undefined reference to `nft_meta_set_eval' This can happen because the NF_TABLES_BRIDGE dependency itself is just a 'bool'. Make the symbol a 'tristate' instead so Kconfig can propagate the dependencies correctly.

Arnd Bergmann committed 7 years ago

Commit dfee0e91 parent fc2f14f3 files · +3 −3Browse files

Unified · Split

3 files
  1. net/bridge/netfilter/Kconfig +1 −1
  2. net/netfilter/nft_chain_filter.c +1 −1
  3. net/netfilter/nft_meta.c +1 −1
net/bridge/netfilter/Kconfig+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 menuconfig NF_TABLES_BRIDGE
77 depends on BRIDGE && NETFILTER && NF_TABLES
88 select NETFILTER_FAMILY_BRIDGE
9− bool "Ethernet Bridge nf_tables support"
9+ tristate "Ethernet Bridge nf_tables support"
1010
1111 if NF_TABLES_BRIDGE
1212
net/netfilter/nft_chain_filter.c+1−1
@@ -193,7 +193,7 @@ static inline void nft_chain_filter_inet_init(void) {} · 192 unmodified lines
193193 static inline void nft_chain_filter_inet_fini(void) {}
194194 #endif /* CONFIG_NF_TABLES_IPV6 */
195195
196−#ifdef CONFIG_NF_TABLES_BRIDGE
196+#if IS_ENABLED(CONFIG_NF_TABLES_BRIDGE)
197197 static unsigned int
198198 nft_do_chain_bridge(void *priv,
199199 struct sk_buff *skb,
net/netfilter/nft_meta.c+1−1
@@ -546,7 +546,7 @@ nft_meta_select_ops(const struct nft_ctx *ctx, · 545 unmodified lines
546546 if (tb[NFTA_META_DREG] && tb[NFTA_META_SREG])
547547 return ERR_PTR(-EINVAL);
548548
549−#if defined(CONFIG_NF_TABLES_BRIDGE) && IS_MODULE(CONFIG_NFT_BRIDGE_META)
549+#if IS_ENABLED(CONFIG_NF_TABLES_BRIDGE) && IS_MODULE(CONFIG_NFT_BRIDGE_META)
550550 if (ctx->family == NFPROTO_BRIDGE)
551551 return ERR_PTR(-EAGAIN);
552552 #endif