[Devel] [PATCH RHEL8 COMMIT] ms/netfilter: add missing IS_ENABLED(CONFIG_NF_TABLES) check to header-file.

Konstantin Khorenko khorenko at virtuozzo.com
Wed Jun 2 19:48:03 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.34
------>
commit 52d5a6eac0bbb9163924848a6840e60378062531
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Wed Jun 2 19:48:03 2021 +0300

    ms/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 at azazel.net>
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
    
    (cherry picked from ms commit 47e640af2e49 ("netfilter: add missing
    IS_ENABLED(CONFIG_NF_TABLES) check to header-file."))
    
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 include/net/netfilter/nf_tables.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 992be11dbc56..fd2057a95a14 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -1244,6 +1244,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
@@ -1317,6 +1319,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


More information about the Devel mailing list