Browse Source

zerotier: update zerotier to 1.2.2

Signed-off-by: Moritz Warning <moritzwarning@web.de>
lilik-openwrt-22.03
Moritz Warning 8 years ago
parent
commit
e684cb8bb8
8 changed files with 97 additions and 175 deletions
  1. +5
    -5
      net/zerotier/Config.in
  2. +8
    -16
      net/zerotier/Makefile
  3. +0
    -44
      net/zerotier/patches/0001-Fix-for-running-under-MUSL-libc-e.g.-Alpine-Linux.patch
  4. +28
    -0
      net/zerotier/patches/0001-prevent-D_FORTIFY_SOURCE-from-being-defined-twice.patch
  5. +0
    -51
      net/zerotier/patches/0002-fix-build.patch
  6. +56
    -0
      net/zerotier/patches/0002-make-natpmp-miniupnpc-configurable.patch
  7. +0
    -27
      net/zerotier/patches/0003-workaround_to_avoid_seg_faults.patch
  8. +0
    -32
      net/zerotier/patches/0005-use-external-miniupnpc-and-natpmp.patch

+ 5
- 5
net/zerotier/Config.in View File

@ -6,18 +6,18 @@ config ZEROTIER_ENABLE_DEBUG
depends on PACKAGE_zerotier
default n
config ZEROTIER_USE_MINIUPNPC
bool "Build with MiniUPnPc"
config ZEROTIER_ENABLE_PORTMAPPING
bool "Build with MiniUPnPc and NAT-PMP support"
depends on PACKAGE_zerotier
default n
config ZEROTIER_ENABLE_NETWORK_CONTROLLER
bool "Build with network controller"
config ZEROTIER_ENABLE_CLUSTER
bool "Build with cluster support"
depends on PACKAGE_zerotier
default n
config ZEROTIER_ENABLE_SELFTEST
bool "Build a self test program"
bool "Build self test program"
depends on PACKAGE_zerotier
default n


+ 8
- 16
net/zerotier/Makefile View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=zerotier
PKG_VERSION:=1.1.14
PKG_VERSION:=1.2.2
PKG_RELEASE:=4
PKG_LICENSE:=GPL-3.0
@ -14,19 +14,18 @@ PKG_LICENSE:=GPL-3.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/zerotier/ZeroTierOne
PKG_SOURCE_SUBDIR:=ZeroTierOne-$(PKG_VERSION)
PKG_SOURCE_VERSION:=ae491c277e6f35d1acbdcbf700e2b834957295ae
PKG_SOURCE_VERSION:=cfe0d0971f3ce5972d955250dc1ff6ec7a30e3f7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_MIRROR_MD5SUM:=c8c3219c995a59161832d580a194f6280de7a4eef75cebece6f38400b64f003e
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_DEPENDS:=uclibcxx
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/zerotier
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libpthread +kmod-tun +ip +ZEROTIER_ENABLE_NETWORK_CONTROLLER:libsqlite3 +ZEROTIER_USE_MINIUPNPC:libminiupnpc +ZEROTIER_USE_MINIUPNPC:libnatpmp
DEPENDS:=+libpthread +kmod-tun +ip +libstdcpp +ZEROTIER_ENABLE_PORTMAPPING:libminiupnpc +ZEROTIER_ENABLE_PORTMAPPING:libnatpmp
TITLE:=Create flat virtual Ethernet networks of almost unlimited size
URL:=https://www.zerotier.com
SUBMENU:=VPN
@ -41,25 +40,18 @@ define Package/zerotier/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(CONFIG_ZEROTIER_ENABLE_NETWORK_CONTROLLER),y)
MAKE_FLAGS += ZT_ENABLE_NETWORK_CONTROLLER=1
MAKE_FLAGS += LDLIBS+=" -lsqlite3 "
ifeq ($(CONFIG_ZEROTIER_ENABLE_CLUSTER),y)
MAKE_FLAGS += ZT_ENABLE_CLUSTER=1
endif
ifeq ($(CONFIG_ZEROTIER_USE_MINIUPNPC),y)
MAKE_FLAGS += ZT_USE_MINIUPNPC=1
ifeq ($(CONFIG_ZEROTIER_ENABLE_PORTMAPPING),y)
MAKE_FLAGS += ZT_ENABLE_PORTMAPPING=1
endif
ifeq ($(CONFIG_ZEROTIER_ENABLE_DEBUG),y)
TARGET_CXXFLAGS += -DZT_TRACE -ggdb3
endif
MAKE_FLAGS += \
DEFS="" \
LDFLAGS+=" -L$(STAGING_DIR)/usr/lib/uClibc++ -pthread " \
LDLIBS+=" -fno-builtin -nodefaultlibs -Wl,-Bstatic -luClibc++ -Wl,-Bdynamic -lpthread -lm -lc -lsupc++ -lc -lgcc -lgcc_eh -lgcc_s -lssp_nonshared " \
CXXFLAGS+=" -fno-builtin -nostdinc++ -I$(STAGING_DIR)/usr/include/uClibc++ -DGCC_HASCLASSVISIBILITY -Wall -fPIE -fvisibility=hidden "
define Build/Compile
$(call Build/Compile/Default,one)
ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
@ -71,7 +63,7 @@ define Package/zerotier/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-one $(1)/usr/bin/
$(LN) zerotier-one $(1)/usr/bin/zerotier-cli
$(LN) zerotier-one $(1)/usr/bin//zerotier-idtool
$(LN) zerotier-one $(1)/usr/bin/zerotier-idtool
ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
$(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-selftest $(1)/usr/bin/


+ 0
- 44
net/zerotier/patches/0001-Fix-for-running-under-MUSL-libc-e.g.-Alpine-Linux.patch View File

@ -1,44 +0,0 @@
From 830250759cd4c14ca2ae5ddf24f0a0427f258622 Mon Sep 17 00:00:00 2001
From: Adam Ierymenko <adam.ierymenko@gmail.com>
Date: Tue, 26 Jul 2016 16:36:20 -0700
Subject: [PATCH 1/2] Fix for running under MUSL libc (e.g. Alpine Linux)
---
osdep/Thread.hpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/osdep/Thread.hpp b/osdep/Thread.hpp
index 7fb38d8..4f90dc0 100644
--- a/osdep/Thread.hpp
+++ b/osdep/Thread.hpp
@@ -125,6 +125,10 @@ public:
throw()
{
memset(&_tid,0,sizeof(_tid));
+ pthread_attr_init(&_tattr);
+#ifdef __LINUX__
+ pthread_attr_setstacksize(&_tattr,8388608); // for MUSL libc and others, has no effect in normal glibc environments
+#endif
_started = false;
}
@@ -157,7 +161,7 @@ public:
{
Thread t;
t._started = true;
- if (pthread_create(&t._tid,(const pthread_attr_t *)0,&___zt_threadMain<C>,instance))
+ if (pthread_create(&t._tid,&t._tattr,&___zt_threadMain<C>,instance))
throw std::runtime_error("pthread_create() failed, unable to create thread");
return t;
}
@@ -184,6 +188,7 @@ public:
private:
pthread_t _tid;
+ pthread_attr_t _tattr;
volatile bool _started;
};
--
2.9.0

+ 28
- 0
net/zerotier/patches/0001-prevent-D_FORTIFY_SOURCE-from-being-defined-twice.patch View File

@ -0,0 +1,28 @@
From 4fd495fca8417a8fd4405951d1eee80f345eaf9b Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Sun, 19 Mar 2017 01:13:14 +0100
Subject: [PATCH 1/2] prevent D_FORTIFY_SOURCE from being defined twice
---
make-linux.mk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/make-linux.mk b/make-linux.mk
index 7c77f58f..508d8c42 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -8,9 +8,10 @@ ifeq ($(origin CXX),default)
endif
INCLUDES?=
-DEFS?=-D_FORTIFY_SOURCE=2
+DEFS?=
LDLIBS?=
DESTDIR?=
+ZT_ENABLE_PORTMAPPING?=0
include objects.mk
--
2.12.0

+ 0
- 51
net/zerotier/patches/0002-fix-build.patch View File

@ -1,51 +0,0 @@
From 333bbabc6dfad0553fb63d560ab6442a50cc9e52 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Fri, 22 Jul 2016 23:27:31 +0200
Subject: [PATCH 2/2] fix build
---
make-linux.mk | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -39,24 +39,24 @@ include objects.mk
# On Linux we auto-detect the presence of some libraries and if present we
# link against the system version. This works with our package build images.
-ifeq ($(wildcard /usr/include/lz4.h),)
+#ifeq ($(wildcard $(STAGING_DIR)/usr/include/lz4.h),)
OBJS+=ext/lz4/lz4.o
-else
- LDLIBS+=-llz4
- DEFS+=-DZT_USE_SYSTEM_LZ4
-endif
-ifeq ($(wildcard /usr/include/http_parser.h),)
+#else
+# LDLIBS+=-llz4
+# DEFS+=-DZT_USE_SYSTEM_LZ4
+#endif
+#ifeq ($(wildcard $(STAGING_DIR)/usr/include/http_parser.h),)
OBJS+=ext/http-parser/http_parser.o
-else
- LDLIBS+=-lhttp_parser
- DEFS+=-DZT_USE_SYSTEM_HTTP_PARSER
-endif
-ifeq ($(wildcard /usr/include/json-parser/json.h),)
+#else
+# LDLIBS+=-lhttp_parser
+# DEFS+=-DZT_USE_SYSTEM_HTTP_PARSER
+#endif
+#ifeq ($(wildcard $(STAGING_DIR)/usr/include/json-parser/json.h),)
OBJS+=ext/json-parser/json.o
-else
- LDLIBS+=-ljsonparser
- DEFS+=-DZT_USE_SYSTEM_JSON_PARSER
-endif
+#else
+# LDLIBS+=-ljsonparser
+# DEFS+=-DZT_USE_SYSTEM_JSON_PARSER
+#endif
ifeq ($(ZT_USE_MINIUPNPC),1)
OBJS+=osdep/PortMapper.o

+ 56
- 0
net/zerotier/patches/0002-make-natpmp-miniupnpc-configurable.patch View File

@ -0,0 +1,56 @@
From b8390696d81f66109560d12046bb63b9704e07f3 Mon Sep 17 00:00:00 2001
From: Moritz Warning <moritzwarning@web.de>
Date: Sun, 19 Mar 2017 01:14:10 +0100
Subject: [PATCH 2/2] make natpmp/miniupnpc configurable
also include staging_dir variable in the search paths
---
make-linux.mk | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/make-linux.mk b/make-linux.mk
index 508d8c42..36060857 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -22,20 +22,24 @@ OBJS+=ext/http-parser/http_parser.o
# Auto-detect miniupnpc and nat-pmp as well and use system libs if present,
# otherwise build into binary as done on Mac and Windows.
OBJS+=osdep/PortMapper.o
-DEFS+=-DZT_USE_MINIUPNPC
-MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h && echo 1)
-ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1)
- DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
- LDLIBS+=-lminiupnpc
-else
- 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
- 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
-ifeq ($(wildcard /usr/include/natpmp.h),)
- OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
-else
- LDLIBS+=-lnatpmp
- DEFS+=-DZT_USE_SYSTEM_NATPMP
+
+ifeq ($(ZT_ENABLE_PORTMAPPING),1)
+ DEFS+=-DZT_USE_MINIUPNPC
+ MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' $(STAGING_DIR)/usr/include/miniupnpc/miniupnpc.h && echo 1)
+ ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1)
+ DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
+ LDLIBS+=-lminiupnpc
+ else
+ 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
+ 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
+
+ ifeq ($(wildcard $(STAGING_DIR)/usr/include/natpmp.h),)
+ OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
+ else
+ LDLIBS+=-lnatpmp
+ DEFS+=-DZT_USE_SYSTEM_NATPMP
+ endif
endif
ifeq ($(ZT_ENABLE_CLUSTER),1)
--
2.12.0

+ 0
- 27
net/zerotier/patches/0003-workaround_to_avoid_seg_faults.patch View File

@ -1,27 +0,0 @@
From 21f4958bd48cae59b478b1b3445e00fa4fb18991 Mon Sep 17 00:00:00 2001
From: muebau <muebau@gmail.com>
Date: Fri, 5 Aug 2016 19:22:45 +0200
Subject: [PATCH] OpenWRT workaround to avoid seg faults
---
service/OneService.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/service/OneService.cpp b/service/OneService.cpp
index 13820f5..9ba3238 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -862,8 +862,8 @@ public:
}
// Start two background threads to handle expensive ops out of line
- Thread::start(_node);
- Thread::start(_node);
+ //Thread::start(_node);
+ //Thread::start(_node);
_nextBackgroundTaskDeadline = 0;
uint64_t clockShouldBe = OSUtils::now();
--
2.7.4

+ 0
- 32
net/zerotier/patches/0005-use-external-miniupnpc-and-natpmp.patch View File

@ -1,32 +0,0 @@
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -64,7 +64,8 @@ ifeq ($(ZT_USE_MINIUPNPC),1)
DEFS+=-DZT_USE_MINIUPNPC
# Auto-detect libminiupnpc at least v2.0
- MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h && echo 1)
+ #MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' $(STAGING_DIR)/usr/include/miniupnpc/miniupnpc.h && echo 1)
+ MINIUPNPC_IS_NEW_ENOUGH=1
ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1)
DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
LDLIBS+=-lminiupnpc
@@ -74,7 +75,7 @@ ifeq ($(ZT_USE_MINIUPNPC),1)
endif
# Auto-detect libnatpmp
- ifeq ($(wildcard /usr/include/natpmp.h),)
+ ifeq ($(wildcard $(STAGING_DIR)/usr/include/natpmp.h),)
OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
else
LDLIBS+=-lnatpmp
--- a/osdep/PortMapper.cpp
+++ b/osdep/PortMapper.cpp
@@ -180,7 +180,7 @@ public:
struct IGDdatas data;
int upnpError = 0;
- UPNPDev *devlist = upnpDiscoverAll(5000,(const char *)0,(const char *)0,0,0,2,&upnpError);
+ UPNPDev *devlist = upnpDiscoverAll(5000,(const char *)0,(const char *)0,0,0,&upnpError);
if (devlist) {
#ifdef ZT_PORTMAPPER_TRACE

Loading…
Cancel
Save