[ovs-dev] [PATCH 09/11] datapath: Replace removed NF_NAT_NEEDED with IS_ENABLED(CONFIG_NF_NAT)

Yi-Hung Wei yihung.wei at gmail.com
Mon Oct 14 17:37:49 UTC 2019


Backports the following upstream commit with some backward compatibility
change.

commit f319ca6557c10a711facc4dd60197470796d3ec1
Author: Geert Uytterhoeven <geert at linux-m68k.org>
Date:   Wed May 8 08:52:32 2019 +0200

    openvswitch: Replace removed NF_NAT_NEEDED with IS_ENABLED(CONFIG_NF_NAT)

    Commit 4806e975729f99c7 ("netfilter: replace NF_NAT_NEEDED with
    IS_ENABLED(CONFIG_NF_NAT)") removed CONFIG_NF_NAT_NEEDED, but a new user
    popped up afterwards.

    Fixes: fec9c271b8f1bde1 ("openvswitch: load and reference the NAT helper.")
    Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
    Acked-by: Florian Westphal <fw at strlen.de>
    Acked-by: Flavio Leitner <fbl at redhat.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Signed-off-by: Yi-Hung Wei <yihung.wei at gmail.com>
---
 datapath/conntrack.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/datapath/conntrack.c b/datapath/conntrack.c
index 86e7dd24bb9b..ba73962b2214 100644
--- a/datapath/conntrack.c
+++ b/datapath/conntrack.c
@@ -1406,7 +1406,7 @@ static int ovs_ct_add_helper(struct ovs_conntrack_info *info, const char *name,
 		return -ENOMEM;
 	}
 
-#ifdef CONFIG_NF_NAT_NEEDED
+#if IS_ENABLED(CONFIG_NF_NAT_NEEDED)
 	if (info->nat) {
 		ret = nf_nat_helper_try_module_get(name, info->family,
 						   key->ip.proto);
@@ -1909,7 +1909,7 @@ void ovs_ct_free_action(const struct nlattr *a)
 static void __ovs_ct_free_action(struct ovs_conntrack_info *ct_info)
 {
 	if (ct_info->helper) {
-#ifdef CONFIG_NF_NAT_NEEDED
+#if IS_ENABLED(CONFIG_NF_NAT_NEEDED)
 		if (ct_info->nat)
 			nf_nat_helper_put(ct_info->helper);
 #endif
-- 
2.7.4



More information about the dev mailing list