zerotier: update to 1.8.6
authorMoritz Warning <moritzwarning@web.de>
Tue, 8 Mar 2022 14:55:58 +0000 (15:55 +0100)
committerRosen Penev <rosenp@gmail.com>
Thu, 17 Mar 2022 02:45:14 +0000 (19:45 -0700)
* remove upstreamed gcc10 and cerrno patches
* disable SSO and OIDC as it needs Rust/Cargo support

Signed-off-by: Moritz Warning <moritzwarning@web.de>
net/zerotier/Makefile
net/zerotier/patches/0001-fix-makefile.patch
net/zerotier/patches/0002-fix-compilation-for-arm_cortex-a7-neon.patch [new file with mode: 0644]
net/zerotier/patches/0003-do-not-use-zt-SSO-and-OIDC.patch [new file with mode: 0644]
net/zerotier/patches/0006-gcc10.patch [deleted file]
net/zerotier/patches/0007-add-cerrno-header-for-str-errno.patch [deleted file]
net/zerotier/patches/0008-fix-compilation-for-arm_cortex-a7-neon.patch [deleted file]

index ab0dbe4f27c60e085ffc329ce377e0eb8b15d24a..f7ffd766eb8a7b9a05f3a833fa775b5e158d5cdd 100644 (file)
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zerotier
-PKG_VERSION:=1.8.4
+PKG_VERSION:=1.8.6
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=61b8c1ea5904cc87431939212033bb4d05d11f517860a01cac75f0090d94272b
+PKG_HASH:=40dce71426f2649e5159854c37560f5a0b634c23d4774453dae0b7ef620af22a
 PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de>
@@ -56,7 +56,7 @@ endif
 endef
 
 # Make binary smaller
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
+TARGET_CFLAGS += -ffunction-sections -fdata-sections -fPIE
 TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
 
 define Package/zerotier/conffiles
index 0d0de6470dd18e1f6ca1df979468f49e2dd73831..c5fc53feaf269b87dea40ad2602408eef4be1b82 100644 (file)
@@ -1,3 +1,12 @@
+From 4965b6d10b2f51f4b30a8c0a8f3a64cf48dea635 Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Tue, 8 Mar 2022 19:09:47 +0100
+Subject: [PATCH 1/3] fix makefile
+
+---
+ make-linux.mk | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
 --- a/make-linux.mk
 +++ b/make-linux.mk
 @@ -25,8 +25,8 @@ TIMESTAMP=$(shell date +"%Y%m%d%H%M")
        ONE_OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
  else
        LDLIBS+=-lnatpmp
-@@ -68,11 +68,11 @@ ifeq ($(ZT_DEBUG),1)
-       # C25519 in particular is almost UNUSABLE in -O0 even on a 3ghz box!
- node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CXXFLAGS=-Wall -O2 -g -pthread $(INCLUDES) $(DEFS)
- else
--      CFLAGS?=-O3 -fstack-protector -fPIE
-+      CFLAGS?=-O3 -fstack-protector
-       override CFLAGS+=-Wall -Wno-deprecated -pthread $(INCLUDES) -DNDEBUG $(DEFS)
--      CXXFLAGS?=-O3 -fstack-protector -fPIE
-+      CXXFLAGS?=-O3 -fstack-protector
-       override CXXFLAGS+=-Wall -Wno-deprecated -std=c++11 -pthread $(INCLUDES) -DNDEBUG $(DEFS)
--      LDFLAGS=-pie -Wl,-z,relro,-z,now
-+      LDFLAGS+=-Wl,-z,relro,-z,now
- endif
- ifeq ($(ZT_QNAP), 1)
-@@ -280,7 +280,7 @@ ifeq ($(ZT_CONTROLLER),1)
+@@ -300,7 +300,7 @@ ifeq ($(ZT_CONTROLLER),1)
  endif
  
  # ARM32 hell -- use conservative CFLAGS
diff --git a/net/zerotier/patches/0002-fix-compilation-for-arm_cortex-a7-neon.patch b/net/zerotier/patches/0002-fix-compilation-for-arm_cortex-a7-neon.patch
new file mode 100644 (file)
index 0000000..150129a
--- /dev/null
@@ -0,0 +1,23 @@
+From 8c24328d41a3a25db3b3d73baf86ed2c71160774 Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Mon, 30 Nov 2020 12:25:42 +0100
+Subject: [PATCH 2/3] fix compilation for arm_cortex-a7+neon
+
+Fixes "error: 'vrbitq_u8' was not declared in this scope"
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ node/Constants.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/node/Constants.hpp
++++ b/node/Constants.hpp
+@@ -118,7 +118,7 @@
+ #include <immintrin.h>
+ #endif
+-#if (defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(ZT_ARCH_ARM_HAS_NEON))
++#if (defined(__aarch64__) || defined(ZT_ARCH_ARM_HAS_NEON))
+ #if (defined(__APPLE__) && !defined(__LP64__)) || (defined(__ANDROID__) && defined(__arm__))
+ #ifdef ZT_ARCH_ARM_HAS_NEON
+ #undef ZT_ARCH_ARM_HAS_NEON
diff --git a/net/zerotier/patches/0003-do-not-use-zt-SSO-and-OIDC.patch b/net/zerotier/patches/0003-do-not-use-zt-SSO-and-OIDC.patch
new file mode 100644 (file)
index 0000000..297f4e7
--- /dev/null
@@ -0,0 +1,38 @@
+From 826718bdbbd42fcf56bdb45dd9e71af10299cfa3 Mon Sep 17 00:00:00 2001
+From: Oskari Rauta <oskari.rauta@gmail.com>
+Date: Sun, 13 Mar 2022 10:06:08 +0100
+Subject: [PATCH 3/3] do not use zt SSO and OIDC
+
+These features need Rust/Cargo support
+in the build system. OpenWrt does not
+have that yet.
+---
+ make-linux.mk      | 4 ++++
+ node/Constants.hpp | 3 +++
+ 2 files changed, 7 insertions(+)
+
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -268,6 +268,10 @@ ifeq ($(ZT_IA32),1)
+ endif
+ ifeq ($(ZT_SSO_SUPPORTED), 1)
++      ZT_SSO_SUPPORTED=0
++endif
++
++ifeq ($(ZT_SSO_SUPPORTED), 1)
+       ifeq ($(ZT_DEBUG),1)
+               LDLIBS+=zeroidc/target/debug/libzeroidc.a -ldl -lssl -lcrypto
+       else
+--- a/node/Constants.hpp
++++ b/node/Constants.hpp
+@@ -72,6 +72,9 @@
+ #include <machine/endian.h>
+ #endif
++#undef OIDC_SUPPORTED
++#define OIDC_SUPPORTED 0
++
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ #define OIDC_SUPPORTED 0
+ #ifndef __UNIX_LIKE__
diff --git a/net/zerotier/patches/0006-gcc10.patch b/net/zerotier/patches/0006-gcc10.patch
deleted file mode 100644 (file)
index 0df0318..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/osdep/Binder.hpp
-+++ b/osdep/Binder.hpp
-@@ -440,9 +440,9 @@ class Binder {
-                                       }
- #endif         // __LINUX__
-                                       if (_bindingCount < ZT_BINDER_MAX_BINDINGS) {
--                                              _bindings[_bindingCount].udpSock = udps;
--                                              _bindings[_bindingCount].tcpListenSock = tcps;
--                                              _bindings[_bindingCount].address = ii->first;
-+                                              _bindings[(unsigned int)_bindingCount].udpSock = udps;
-+                                              _bindings[(unsigned int)_bindingCount].tcpListenSock = tcps;
-+                                              _bindings[(unsigned int)_bindingCount].address = ii->first;
-                                               phy.setIfName(udps, (char*)ii->second.c_str(), (int)ii->second.length());
-                                               ++_bindingCount;
-                                       }
diff --git a/net/zerotier/patches/0007-add-cerrno-header-for-str-errno.patch b/net/zerotier/patches/0007-add-cerrno-header-for-str-errno.patch
deleted file mode 100644 (file)
index d2595f9..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-From e06177a74f1e4314baf17c52f360dabcb78e69cd Mon Sep 17 00:00:00 2001
-From: Moritz Warning <moritzwarning@web.de>
-Date: Sun, 29 Nov 2020 19:45:36 +0100
-Subject: [PATCH 7/8] add cerrno header for (str)errno
-
-Fixes compilation under libcxx.
-
-Signed-off-by: Rosen Penev <rosenp@gmail.com>
----
- osdep/LinuxNetLink.cpp | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/osdep/LinuxNetLink.cpp
-+++ b/osdep/LinuxNetLink.cpp
-@@ -22,6 +22,8 @@
- #include <unistd.h>
- #include <linux/if_tun.h>
-+#include <cerrno>
-+
- #ifndef IFNAMSIZ
- #define IFNAMSIZ 16
- #endif
diff --git a/net/zerotier/patches/0008-fix-compilation-for-arm_cortex-a7-neon.patch b/net/zerotier/patches/0008-fix-compilation-for-arm_cortex-a7-neon.patch
deleted file mode 100644 (file)
index 88b640f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-From 7ac88ced6cdedf88ccebfc1de12d92b269d4a60a Mon Sep 17 00:00:00 2001
-From: Moritz Warning <moritzwarning@web.de>
-Date: Mon, 30 Nov 2020 12:25:42 +0100
-Subject: [PATCH 8/8] fix compilation for arm_cortex-a7+neon
-
-Fixes "error: 'vrbitq_u8' was not declared in this scope"
-
-Signed-off-by: Rosen Penev <rosenp@gmail.com>
----
- node/Constants.hpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/node/Constants.hpp
-+++ b/node/Constants.hpp
-@@ -109,7 +109,7 @@
- #include <immintrin.h>
- #endif
--#if (defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(ZT_ARCH_ARM_HAS_NEON))
-+#if (defined(__aarch64__) || defined(ZT_ARCH_ARM_HAS_NEON))
- #if (defined(__APPLE__) && !defined(__LP64__)) || (defined(__ANDROID__) && defined(__arm__))
- #ifdef ZT_ARCH_ARM_HAS_NEON
- #undef ZT_ARCH_ARM_HAS_NEON