Browse Source

Merge pull request #13971 from mwarning/zerotier

zerotier: update to 1.6.1
lilik-openwrt-22.03
Rosen Penev 4 years ago
committed by GitHub
parent
commit
e5a526e516
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 125 additions and 100 deletions
  1. +3
    -3
      net/zerotier/Makefile
  2. +5
    -5
      net/zerotier/patches/0001-find-miniupnpc.h-in-staging-directory.patch
  3. +5
    -5
      net/zerotier/patches/0002-remove-pie.patch
  4. +7
    -7
      net/zerotier/patches/0003-remove-arm32-conservative-CFLAGS.patch
  5. +5
    -5
      net/zerotier/patches/0004-accept-external-linker-flags.patch
  6. +15
    -1
      net/zerotier/patches/0005-link-natpmp.patch
  7. +29
    -0
      net/zerotier/patches/0006-gcc10.patch
  8. +28
    -0
      net/zerotier/patches/0007-add-cerrno-header-for-str-errno.patch
  9. +28
    -0
      net/zerotier/patches/0008-fix-compilation-for-arm_cortex-a7-neon.patch
  10. +0
    -10
      net/zerotier/patches/010-mangix.patch
  11. +0
    -25
      net/zerotier/patches/020-musl.patch
  12. +0
    -39
      net/zerotier/patches/030-gcc10.patch

+ 3
- 3
net/zerotier/Makefile View File

@ -6,12 +6,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=zerotier
PKG_VERSION:=1.4.6
PKG_RELEASE:=5
PKG_VERSION:=1.6.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)?
PKG_HASH:=d1a0eeb03acfa446f67adf5901902d17de14b4648c21e160024acf476e3d4fba
PKG_HASH:=9ac8adb0b28acf46d8f37f63b46a551ab20d77edf590aceb0b781e3eb5486571
PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION)
PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de>


+ 5
- 5
net/zerotier/patches/0001-find-miniupnpc.h-in-staging-directory.patch View File

@ -1,17 +1,17 @@
From 14454285d7ef5b9cd134c86059933036c1aa2fef Mon Sep 17 00:00:00 2001
From 552cda1ebff6c5182eecdcb35961fd6b441dfa52 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Mon, 23 Apr 2018 22:12:31 +0200
Subject: [PATCH 1/4] find miniupnpc.h in staging directory
Subject: [PATCH 1/8] find miniupnpc.h in staging directory
---
make-linux.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/make-linux.mk b/make-linux.mk
index b81c7aeb..a547125d 100644
index 03cce517..cae8459a 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -29,8 +29,8 @@ TIMESTAMP=$(shell date +"%Y%m%d%H%M")
@@ -25,8 +25,8 @@ TIMESTAMP=$(shell date +"%Y%m%d%H%M")
# otherwise build into binary as done on Mac and Windows.
ONE_OBJS+=osdep/PortMapper.o
override DEFS+=-DZT_USE_MINIUPNPC
@ -23,5 +23,5 @@ index b81c7aeb..a547125d 100644
override DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
LDLIBS+=-lminiupnpc
--
2.22.0
2.29.2

+ 5
- 5
net/zerotier/patches/0002-remove-pie.patch View File

@ -1,7 +1,7 @@
From 68fe97ef6b05e3709cd4b67c7681dcfc63bfaf80 Mon Sep 17 00:00:00 2001
From ef1a75fd1bf271cc5c73d966a861dfcd26d62cd5 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Mon, 30 Apr 2018 16:14:30 +0200
Subject: [PATCH 2/4] remove -pie
Subject: [PATCH 2/8] remove -pie
fixes relocation "against `a local symbol' can not be used
when making a shared object; recompile with -fPIC" error
@ -10,10 +10,10 @@ when making a shared object; recompile with -fPIC" error
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/make-linux.mk b/make-linux.mk
index a547125d..13244741 100644
index cae8459a..bd05e6b5 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -77,11 +77,11 @@ ifeq ($(ZT_DEBUG),1)
@@ -73,11 +73,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
@ -29,5 +29,5 @@ index a547125d..13244741 100644
STRIP+=--strip-all
endif
--
2.22.0
2.29.2

+ 7
- 7
net/zerotier/patches/0003-remove-arm32-conservative-CFLAGS.patch View File

@ -1,25 +1,25 @@
From a856855ab97e0775a08e1571a4ad26c264cb13f4 Mon Sep 17 00:00:00 2001
From 093ec88ff213a5713ad5d3c26ddf5ecdea3c6377 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Sun, 4 Aug 2019 03:56:37 +0200
Subject: [PATCH 3/4] remove arm32 conservative CFLAGS
Subject: [PATCH 3/8] remove arm32 conservative CFLAGS
---
make-linux.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make-linux.mk b/make-linux.mk
index 13244741..fd164dfa 100644
index bd05e6b5..b1bb638e 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -262,7 +262,7 @@ ifeq ($(ZT_OFFICIAL),1)
@@ -276,7 +276,7 @@ ifeq ($(ZT_CONTROLLER),1)
endif
# ARM32 hell -- use conservative CFLAGS
-ifeq ($(ZT_ARCHITECTURE),3)
+ifeq (0,3)
ifeq ($(shell if [ -e /usr/bin/dpkg ]; then dpkg --print-architecture; fi),armel)
override CFLAGS+=-march=armv5 -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
override CXXFLAGS+=-march=armv5 -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
override CFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
override CXXFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
--
2.22.0
2.29.2

+ 5
- 5
net/zerotier/patches/0004-accept-external-linker-flags.patch View File

@ -1,17 +1,17 @@
From 5169e5328525af28f6b7de087ece10a9bc0a2282 Mon Sep 17 00:00:00 2001
From 1a4ffe62c729f9c4f63cdfd26151e3724bc23f86 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Wed, 2 May 2018 16:06:46 +0200
Subject: [PATCH 4/4] accept external linker flags
Subject: [PATCH 4/8] accept external linker flags
---
make-linux.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make-linux.mk b/make-linux.mk
index fd164dfa..29ff8813 100644
index b1bb638e..d358ecfb 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -81,7 +81,7 @@ else
@@ -77,7 +77,7 @@ else
override CFLAGS+=-Wall -Wno-deprecated -pthread $(INCLUDES) -DNDEBUG $(DEFS)
CXXFLAGS?=-O3 -fstack-protector
override CXXFLAGS+=-Wall -Wno-deprecated -std=c++11 -pthread $(INCLUDES) -DNDEBUG $(DEFS)
@ -21,5 +21,5 @@ index fd164dfa..29ff8813 100644
STRIP+=--strip-all
endif
--
2.22.0
2.29.2

+ 15
- 1
net/zerotier/patches/0005-link-natpmp.patch View File

@ -1,6 +1,17 @@
From de625c51dba36b390c93a1db00b19b6112178764 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Sat, 21 Nov 2020 17:53:28 +0100
Subject: [PATCH 5/8] link natpmp
---
make-linux.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/make-linux.mk b/make-linux.mk
index d358ecfb..cbee51c3 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -38,7 +38,7 @@ else
@@ -34,7 +34,7 @@ else
override DEFS+=-DMINIUPNP_STATICLIB -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DOS_STRING=\"Linux\" -DMINIUPNPC_VERSION_STRING=\"2.0\" -DUPNP_VERSION_STRING=\"UPnP/1.1\" -DENABLE_STRNATPMPERR
ONE_OBJS+=ext/miniupnpc/connecthostport.o ext/miniupnpc/igd_desc_parse.o ext/miniupnpc/minisoap.o ext/miniupnpc/minissdpc.o ext/miniupnpc/miniupnpc.o ext/miniupnpc/miniwget.o ext/miniupnpc/minixml.o ext/miniupnpc/portlistingparse.o ext/miniupnpc/receivedata.o ext/miniupnpc/upnpcommands.o ext/miniupnpc/upnpdev.o ext/miniupnpc/upnperrors.o ext/miniupnpc/upnpreplyparse.o
endif
@ -9,3 +20,6 @@
ONE_OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
else
LDLIBS+=-lnatpmp
--
2.29.2

+ 29
- 0
net/zerotier/patches/0006-gcc10.patch View File

@ -0,0 +1,29 @@
From e0c76c5ccf049d22bc47d723567926346e4d3639 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Sat, 21 Nov 2020 18:19:21 +0100
Subject: [PATCH 6/8] gcc10
---
osdep/Binder.hpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/osdep/Binder.hpp b/osdep/Binder.hpp
index c52f303b..8a38ab04 100644
--- a/osdep/Binder.hpp
+++ b/osdep/Binder.hpp
@@ -396,9 +396,9 @@ public:
}
#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;
}
--
2.29.2

+ 28
- 0
net/zerotier/patches/0007-add-cerrno-header-for-str-errno.patch View File

@ -0,0 +1,28 @@
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(+)
diff --git a/osdep/LinuxNetLink.cpp b/osdep/LinuxNetLink.cpp
index 421da1f6..b7c13edf 100644
--- 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
--
2.29.2

+ 28
- 0
net/zerotier/patches/0008-fix-compilation-for-arm_cortex-a7-neon.patch View File

@ -0,0 +1,28 @@
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(-)
diff --git a/node/Constants.hpp b/node/Constants.hpp
index 400976c1..eccc3a31 100644
--- 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
--
2.29.2

+ 0
- 10
net/zerotier/patches/010-mangix.patch View File

@ -1,10 +0,0 @@
--- a/osdep/LinuxNetLink.hpp
+++ b/osdep/LinuxNetLink.hpp
@@ -18,6 +18,7 @@
#ifdef __LINUX__
+#include <cerrno>
#include <vector>
#include <sys/socket.h>

+ 0
- 25
net/zerotier/patches/020-musl.patch View File

@ -1,25 +0,0 @@
--- a/osdep/OSUtils.hpp
+++ b/osdep/OSUtils.hpp
@@ -37,9 +37,6 @@
#include <sys/time.h>
#include <sys/stat.h>
#include <arpa/inet.h>
-#ifdef __LINUX__
-#include <sys/syscall.h>
-#endif
#endif
#ifndef OMIT_JSON_SUPPORT
@@ -211,11 +208,8 @@ public:
return (int64_t)( ((tmp.QuadPart - 116444736000000000LL) / 10000L) + st.wMilliseconds );
#else
struct timeval tv;
-#ifdef __LINUX__
- syscall(SYS_gettimeofday,&tv,0); /* fix for musl libc broken gettimeofday bug */
-#else
gettimeofday(&tv,(struct timezone *)0);
-#endif
+
return ( (1000LL * (int64_t)tv.tv_sec) + (int64_t)(tv.tv_usec / 1000) );
#endif
};

+ 0
- 39
net/zerotier/patches/030-gcc10.patch View File

@ -1,39 +0,0 @@
From cce4fa719d447c55d93458b25fa92717a2d61a60 Mon Sep 17 00:00:00 2001
From: Jonas Witschel <diabonas@archlinux.org>
Date: Tue, 14 Jul 2020 14:20:16 +0200
Subject: [PATCH] Fix compilation with GCC 10 by providing explicit cast of
_bindingCount
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Compilation with GCC 10 fails with the following error:
service/../osdep/Binder.hpp: In member function ‘void ZeroTier::Binder::refresh(ZeroTier::Phy<PHY_HANDLER_TYPE>&, unsigned int*, unsigned int, std::vector<ZeroTier::InetAddress>, INTERFACE_CHECKER&)’:
service/../osdep/Binder.hpp:376:30: internal compiler error: unexpected expression ‘(std::__atomic_base<unsigned int>::__int_type)((ZeroTier::Binder*)this)->ZeroTier::Binder::_bindingCount’ of kind implicit_conv_expr
376 | _bindings[_bindingCount].udpSock = udps;
| ^
Help the compiler by providing an explicit cast to the appropriate type like it
is already done in l. 338 of the same file.
---
osdep/Binder.hpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/osdep/Binder.hpp b/osdep/Binder.hpp
index 660e6f0c..a5bc85c9 100644
--- a/osdep/Binder.hpp
+++ b/osdep/Binder.hpp
@@ -373,9 +373,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;
}

Loading…
Cancel
Save