openvswitch/datapath-handle-removal-of-.h-file-nf-conntrack-l3proto.patch
2019-09-30 11:11:00 -04:00

51 lines
1.9 KiB
Diff

From 945d6d1c119af9e720c28fdfe3e303bfde0b29da Mon Sep 17 00:00:00 2001
From: Yifeng Sun <pkusunyifeng@gmail.com>
Date: Fri, 10 May 2019 12:30:08 -0700
Subject: [PATCH] datapath: Handle removal of nf_conntrack_l3proto.h
Upstream kernel commit a0ae2562 ("netfilter: conntrack: remove l3proto
abstraction") removed header file net/netfilter/nf_conntrack_l3proto.h.
This patch detects it and fixes compilation errors of OVS on 4.19+ kernels.
Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
acinclude.m4 | 3 +++
datapath/linux/compat/nf_conntrack_proto.c | 2 ++
2 files changed, 5 insertions(+)
diff --git a/acinclude.m4 b/acinclude.m4
index 6c8f970..d664450 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -949,6 +949,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
OVS_FIND_FIELD_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frags],
[rnd],
[OVS_DEFINE([HAVE_INET_FRAGS_RND])])
+ OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_l3proto.h],
+ [nf_conntrack_l3proto],
+ [OVS_DEFINE([HAVE_NF_CONNTRACK_L3PROATO_H])])
if cmp -s datapath/linux/kcompat.h.new \
datapath/linux/kcompat.h >/dev/null 2>&1; then
diff --git a/datapath/linux/compat/nf_conntrack_proto.c b/datapath/linux/compat/nf_conntrack_proto.c
index 4ac66f6..fe291db 100644
--- a/datapath/linux/compat/nf_conntrack_proto.c
+++ b/datapath/linux/compat/nf_conntrack_proto.c
@@ -1,7 +1,9 @@
#include <linux/types.h>
#include <net/netfilter/nf_conntrack.h>
+#ifdef HAVE_NF_CONNTRACK_L3PROATO_H
#include <net/netfilter/nf_conntrack_l3proto.h>
+#endif
/*
* Upstream net-next commmit 7e35ec0e8044
--
2.14.1