openvswitch: fix compilation of intree datapath kmod
authorYousong Zhou <redacted>
Fri, 3 May 2019 15:22:04 +0000 (15:22 +0000)
committerYousong Zhou <redacted>
Fri, 3 May 2019 17:53:03 +0000 (17:53 +0000)
Reference: https://github.com/openwrt/packages/issues/8548#issuecomment-488871090
Signed-off-by: Yousong Zhou <redacted>
net/openvswitch/Makefile
net/openvswitch/patches/0001-netdev-linux-Let-interface-flag-survive-internal-por.patch
net/openvswitch/patches/0002-python-separate-host-target-python-for-cross-compile.patch
net/openvswitch/patches/0003-ovs-lib-fix-install_dir.patch
net/openvswitch/patches/0004-build-disable-building-tests.patch
net/openvswitch/patches/0005-datapath-conntrack-fix-include-for-IP6_DEFRAG_CONNTR.patch [new file with mode: 0644]

index 81c67a3cf2e41358cbe46bf8a983633ad726fea5..57942fe42b2c10ac90464c3709779912563eb42b 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
 # Copyright (C) 2014-2017 OpenWrt.org
-# Copyright (C) 2018 Yousong Zhou <yszhou4tech@gmail.com>
+# Copyright (C) 2018-2019 Yousong Zhou <yszhou4tech@gmail.com>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/kernel.mk
 #
 PKG_NAME:=openvswitch
 PKG_VERSION:=2.11.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.openvswitch.org/releases/
 PKG_HASH:=f4b01d7376d7298bc6e7fa7a6067229ca7c7e299394e5ea9aff651d52edfdbee
index 52ad7c742eb468b563478f65a8e6870794f979b9..33af680592a1c4429e809e6e9d0f7ee12f795ef0 100644 (file)
@@ -1,7 +1,7 @@
-From c7247a20c7779dbeafda7767f4a3c090da37c0c0 Mon Sep 17 00:00:00 2001
+From bfcee43923a4bb07954f6648bde1abdcbfa5d95f Mon Sep 17 00:00:00 2001
 From: Helmut Schaa <helmut.schaa@googlemail.com>
 Date: Wed, 8 Jan 2014 13:48:49 +0100
-Subject: [PATCH 1/4] netdev-linux: Let interface flag survive internal port
+Subject: [PATCH 1/5] netdev-linux: Let interface flag survive internal port
  setup
 
 Due to a race condition when bringing up an internal port on Linux
index 404e22cc5783e47a2466e227fccaed4791b5af9c..5cfbecb25235a70c53b619d3ec6c504fd1d131ed 100644 (file)
@@ -1,7 +1,7 @@
-From 38d142005a0b582efdad5580e311d815ad1f34a4 Mon Sep 17 00:00:00 2001
+From e881c50ff537d4b34c10227360589f83d90ce373 Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <zhouyousong@yunionyun.com>
 Date: Tue, 21 Aug 2018 12:21:05 +0000
-Subject: [PATCH 2/4] python: separate host/target python for cross-compile
+Subject: [PATCH 2/5] python: separate host/target python for cross-compile
 
 At the moment, python-six is a requirement for openvswitch python
 library on target machine.
index f09f6e9f0969e7de1b643d849afcdff94f654204..667f38e0f729447aff08199c6be456c57882bbb3 100644 (file)
@@ -1,7 +1,7 @@
-From b476094a64213da20f88976d7562cb4e8d9f2101 Mon Sep 17 00:00:00 2001
+From b65652ff441c4236b51f037a76147331c1ffd5fd Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <yszhou4tech@gmail.com>
 Date: Wed, 14 Mar 2018 16:44:13 +0800
-Subject: [PATCH 3/4] ovs-lib: fix install_dir()
+Subject: [PATCH 3/5] ovs-lib: fix install_dir()
 
 The command "install" is not available in OpenWrt by default
 
index 8f8d96053bfe9d6511443a02af9bb637a2af90d6..6d552ac08611293f18de1871b9ea03fbe9ba12f2 100644 (file)
@@ -1,7 +1,7 @@
-From d0ffc7cc1a0eb217963099fd90bd437b09b6068d Mon Sep 17 00:00:00 2001
+From 2f9075aca5f54b8d0c14517c408f162985fb1b18 Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <zhouyousong@yunionyun.com>
 Date: Tue, 21 Aug 2018 13:02:21 +0000
-Subject: [PATCH 4/4] build: disable building tests
+Subject: [PATCH 4/5] build: disable building tests
 
 Signed-off-by: Yousong Zhou <zhouyousong@yunionyun.com>
 ---
diff --git a/net/openvswitch/patches/0005-datapath-conntrack-fix-include-for-IP6_DEFRAG_CONNTR.patch b/net/openvswitch/patches/0005-datapath-conntrack-fix-include-for-IP6_DEFRAG_CONNTR.patch
new file mode 100644 (file)
index 0000000..1f77ab5
--- /dev/null
@@ -0,0 +1,46 @@
+From b89f391203c4420eb454cb321e799a64de809f52 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <zhouyousong@yunionyun.com>
+Date: Fri, 3 May 2019 15:03:24 +0000
+Subject: [PATCH 5/5] datapath: conntrack: fix include for
+ IP6_DEFRAG_CONNTRACK_IN
+
+The enum definition is now inside include/net/ipv6_frag.h since upstream commit
+70b095c ("ipv6: remove dependency of nf_defrag_ipv6 on ipv6 module") which was
+backported to stable trees (4.9, 4.14, 4.19) only these days.
+
+The error message
+
+         CC [M]  /opt/buildbot/slaves/lede-slave-tah/mipsel_24kc/build/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/openvswitch-2.11.0/datapath/linux/conntrack.o
+       /opt/buildbot/slaves/lede-slave-tah/mipsel_24kc/build/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/openvswitch-2.11.0/datapath/linux/conntrack.c: In function 'handle_fragments':
+       /opt/buildbot/slaves/lede-slave-tah/mipsel_24kc/build/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/openvswitch-2.11.0/datapath/linux/conntrack.c:554:8: error: variable 'user' has initializer but incomplete type
+          enum ip6_defrag_users user = IP6_DEFRAG_CONNTRACK_IN + zone;
+               ^~~~~~~~~~~~~~~~
+       /opt/buildbot/slaves/lede-slave-tah/mipsel_24kc/build/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/openvswitch-2.11.0/datapath/linux/conntrack.c:554:32: error: 'IP6_DEFRAG_CONNTRACK_IN' undeclared (first use in this function); did you mean 'IP_DEFRAG_CONNTRACK_IN'?
+          enum ip6_defrag_users user = IP6_DEFRAG_CONNTRACK_IN + zone;
+                                       ^~~~~~~~~~~~~~~~~~~~~~~
+                                       IP_DEFRAG_CONNTRACK_IN
+       /opt/buildbot/slaves/lede-slave-tah/mipsel_24kc/build/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/openvswitch-2.11.0/datapath/linux/conntrack.c:554:32: note: each undeclared identifier is reported only once for each function it appears in
+       /opt/buildbot/slaves/lede-slave-tah/mipsel_24kc/build/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/openvswitch-2.11.0/datapath/linux/conntrack.c:554:25: error: storage size of 'user' isn't known
+          enum ip6_defrag_users user = IP6_DEFRAG_CONNTRACK_IN + zone;
+                                ^~~~
+       /opt/buildbot/slaves/lede-slave-tah/mipsel_24kc/build/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/openvswitch-2.11.0/datapath/linux/conntrack.c:554:25: warning: unused variable 'user' [-Wunused-variable]
+       scripts/Makefile.build:326: recipe for target '/opt/buildbot/slaves/lede-slave-tah/mipsel_24kc/build/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/openvswitch-2.11.0/datapath/linux/conntrack.o' failed
+
+Reference: https://github.com/openwrt/packages/issues/8548#issuecomment-488871090
+Signed-off-by: Yousong Zhou <zhouyousong@yunionyun.com>
+---
+ datapath/conntrack.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/datapath/conntrack.c b/datapath/conntrack.c
+index a7dc9e0c3..69bda5a9c 100644
+--- a/datapath/conntrack.c
++++ b/datapath/conntrack.c
+@@ -31,6 +31,7 @@
+ #include <net/netfilter/nf_conntrack_seqadj.h>
+ #include <net/netfilter/nf_conntrack_zones.h>
+ #include <net/netfilter/ipv6/nf_defrag_ipv6.h>
++#include <net/ipv6_frag.h>
+ #ifdef CONFIG_NF_NAT_NEEDED
+ #include <linux/netfilter/nf_nat.h>
git clone https://git.99rst.org/PROJECT