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_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>

authored by

Jeremy Sowden and committed by
Pablo Neira Ayuso
47e640af 9211bfbf

+4
+4
include/net/netfilter/nf_tables.h
··· 1207 1207 #define MODULE_ALIAS_NFT_OBJ(type) \ 1208 1208 MODULE_ALIAS("nft-obj-" __stringify(type)) 1209 1209 1210 + #if IS_ENABLED(CONFIG_NF_TABLES) 1211 + 1210 1212 /* 1211 1213 * The gencursor defines two generations, the currently active and the 1212 1214 * next one. Objects contain a bitmask of 2 bits specifying the generations ··· 1281 1279 { 1282 1280 ext->genmask ^= nft_genmask_next(net); 1283 1281 } 1282 + 1283 + #endif /* IS_ENABLED(CONFIG_NF_TABLES) */ 1284 1284 1285 1285 /* 1286 1286 * We use a free bit in the genmask field to indicate the element