diff mbox series

[ovs-dev] nf_conntrack_proto: Fix HAVE_NET_NS_GET macro for nf_conntrack

Message ID 1544649856-29000-1-git-send-email-pkusunyifeng@gmail.com
State Accepted
Headers show
Series [ovs-dev] nf_conntrack_proto: Fix HAVE_NET_NS_GET macro for nf_conntrack | expand

Commit Message

Yifeng Sun Dec. 12, 2018, 9:24 p.m. UTC
In previous code, macro HAVE_NET_NS_SET is used in code but
never generated by config. This patch fixes it.

Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
---
 acinclude.m4                               | 4 ++--
 datapath/linux/compat/nf_conntrack_proto.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

Yi-Hung Wei Dec. 13, 2018, 1:36 a.m. UTC | #1
On Wed, Dec 12, 2018 at 1:24 PM Yifeng Sun <pkusunyifeng@gmail.com> wrote:
>
> In previous code, macro HAVE_NET_NS_SET is used in code but
> never generated by config. This patch fixes it.
>
> Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
> ---
Thanks for the bug fix.  It resolves compat issues for kernel between
v4.10 and v4.14.

Fixes: 179fccce34db ("compat: Backport nf_ct_netns_{get, put}()")
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>

It would be useful to backport to branch 2.10.

Thanks,

-Yi-Hung
Ben Pfaff Dec. 27, 2018, 7:16 p.m. UTC | #2
On Wed, Dec 12, 2018 at 05:36:25PM -0800, Yi-Hung Wei wrote:
> On Wed, Dec 12, 2018 at 1:24 PM Yifeng Sun <pkusunyifeng@gmail.com> wrote:
> >
> > In previous code, macro HAVE_NET_NS_SET is used in code but
> > never generated by config. This patch fixes it.
> >
> > Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
> > ---
> Thanks for the bug fix.  It resolves compat issues for kernel between
> v4.10 and v4.14.
> 
> Fixes: 179fccce34db ("compat: Backport nf_ct_netns_{get, put}()")
> Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
> 
> It would be useful to backport to branch 2.10.

Thanks, applied to master and branch-2.10.
diff mbox series

Patch

diff --git a/acinclude.m4 b/acinclude.m4
index ed83df43df54..dda93e0970c0 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -619,8 +619,8 @@  AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
                   [nf_ct_is_untracked])
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_zones.h],
                   [nf_ct_zone_init])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_l3proto.h],
-                        [net_ns_get])
+  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_l3proto.h],
+                  [net_ns_get])
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_labels.h],
                   [nf_connlabels_get])
   OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_labels.h],
diff --git a/datapath/linux/compat/nf_conntrack_proto.c b/datapath/linux/compat/nf_conntrack_proto.c
index e877d763892d..4ac66f61c70d 100644
--- a/datapath/linux/compat/nf_conntrack_proto.c
+++ b/datapath/linux/compat/nf_conntrack_proto.c
@@ -11,10 +11,10 @@ 
  *
  * However, we only need this feature if the underlying nf_conntrack_l3proto
  * supports net_ns_get/put.  Thus, we just mock the functions if
- * HAVE_NET_NS_SET is false.
+ * HAVE_NET_NS_GET is false.
  */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
-#ifdef HAVE_NET_NS_SET
+#ifdef HAVE_NET_NS_GET
 static int nf_ct_netns_do_get(struct net *net, u8 nfproto)
 {
 	const struct nf_conntrack_l3proto *l3proto;
@@ -96,7 +96,7 @@  void rpl_nf_ct_netns_put(struct net *net, uint8_t nfproto)
 }
 EXPORT_SYMBOL_GPL(rpl_nf_ct_netns_put);
 
-#else /* !HAVE_NET_NS_SET */
+#else /* !HAVE_NET_NS_GET */
 void rpl_nf_ct_netns_put(struct net *net, uint8_t nfproto)
 {
 }
@@ -108,5 +108,5 @@  int rpl_nf_ct_netns_get(struct net *net, u8 nfproto)
 }
 EXPORT_SYMBOL_GPL(rpl_nf_ct_netns_get);
 
-#endif /* HAVE_NET_NS_SET */
+#endif /* HAVE_NET_NS_GET */
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) */