summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Sowden <jeremy@azazel.net>2019-08-07 17:17:01 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2019-08-13 13:14:58 +0300
commit47e640af2e492cc28778dd6f894d50313f7fba75 (patch)
tree5627461a4e746fd9c0c22f9636e819a494d32e74
parent9211bfbff80a7604273086fec5685efcdc10be2b (diff)
downloadlinux-47e640af2e492cc28778dd6f894d50313f7fba75.tar.xz
netfilter: add missing IS_ENABLED(CONFIG_NF_TABLES) check to header-file.
nf_tables.h defines an API comprising several inline functions and macros that depend on the nft member of struct net. However, this is only defined is CONFIG_NF_TABLES is enabled. Added preprocessor checks to ensure that nf_tables.h will compile if CONFIG_NF_TABLES is disabled. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--include/net/netfilter/nf_tables.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 9b624566b82d..66edf76301d3 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -1207,6 +1207,8 @@ void nft_trace_notify(struct nft_traceinfo *info);
#define MODULE_ALIAS_NFT_OBJ(type) \
MODULE_ALIAS("nft-obj-" __stringify(type))
+#if IS_ENABLED(CONFIG_NF_TABLES)
+
/*
* The gencursor defines two generations, the currently active and the
* next one. Objects contain a bitmask of 2 bits specifying the generations
@@ -1280,6 +1282,8 @@ static inline void nft_set_elem_change_active(const struct net *net,
ext->genmask ^= nft_genmask_next(net);
}
+#endif /* IS_ENABLED(CONFIG_NF_TABLES) */
+
/*
* We use a free bit in the genmask field to indicate the element
* is busy, meaning it is currently being processed either by