aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2018-04-16 13:18:45 +0200
committerGitHub <noreply@github.com>2018-04-16 13:18:45 +0200
commit8f9f2a304401dac93036316cb3275e9709d91846 (patch)
treef3440fa29845b77b767baa4aeb54bcd6f2c5e30b /net
parent3c7d2ae182e4e7c8ae782c850c9b63d70c79ca14 (diff)
parentd014516ac0fff52d15b6f35dba2eef10c1e39785 (diff)
Merge pull request #5908 from mwarning/zerotier
zerotier: fix segfault on ARM
Diffstat (limited to 'net')
-rw-r--r--net/zerotier/Makefile2
-rw-r--r--net/zerotier/files/zerotier.config3
-rw-r--r--net/zerotier/files/zerotier.init25
-rw-r--r--net/zerotier/patches/0005-remove-pie.patch26
4 files changed, 40 insertions, 16 deletions
diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile
index 4731e0b4d..3890092ab 100644
--- a/net/zerotier/Makefile
+++ b/net/zerotier/Makefile
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=zerotier
PKG_VERSION:=1.2.4
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_LICENSE:=GPL-3.0
diff --git a/net/zerotier/files/zerotier.config b/net/zerotier/files/zerotier.config
index 9d49490e3..b62e15532 100644
--- a/net/zerotier/files/zerotier.config
+++ b/net/zerotier/files/zerotier.config
@@ -5,9 +5,6 @@ config zerotier sample_config
# persistent configuration folder (for ZT controller mode)
#option config_path '/etc/zerotier'
- # restart ZT when wan status changed
- option interface 'wan'
-
#option port '9993'
# Generate secret on first start
diff --git a/net/zerotier/files/zerotier.init b/net/zerotier/files/zerotier.init
index d4831bdd5..390dbd312 100644
--- a/net/zerotier/files/zerotier.init
+++ b/net/zerotier/files/zerotier.init
@@ -14,15 +14,17 @@ section_enabled() {
start_instance() {
local cfg="$1"
- local port secret interface config_path
+ local port secret config_path
local ARGS=""
- section_enabled "$cfg" || return 1
+ if ! section_enabled "$cfg"; then
+ echo "disabled in config"
+ return 1
+ fi
config_get config_path $cfg 'config_path'
config_get_bool port $cfg 'port'
config_get secret $cfg 'secret'
- config_get interface $cfg 'interface'
# Remove existing link or folder
rm -rf $CONFIG_PATH
@@ -45,10 +47,13 @@ start_instance() {
if [ "$secret" = "generate" ]; then
echo "Generate secret - please wait..."
- local tmp="/tmp/zt.$cfg.secret"
- zerotier-idtool generate "$tmp" > /dev/null
- secret="$(cat $tmp)"
- rm "$tmp"
+ local sf="/tmp/zt.$cfg.secret"
+
+ zerotier-idtool generate "$sf" > /dev/null
+ [ $? -ne 0 ] && return 1
+
+ secret="$(cat $sf)"
+ rm "$sf"
uci set zerotier.$cfg.secret="$secret"
uci commit zerotier
@@ -68,15 +73,11 @@ start_instance() {
config_list_foreach $cfg 'join' add_join
procd_open_instance
- procd_add_reload_interface_trigger "$interface"
procd_set_param command $PROG $ARGS $CONFIG_PATH
+ procd_set_param stderr 1
procd_close_instance
}
-service_triggers() {
- procd_add_reload_trigger zerotier
-}
-
start_service() {
config_load 'zerotier'
config_foreach start_instance 'zerotier'
diff --git a/net/zerotier/patches/0005-remove-pie.patch b/net/zerotier/patches/0005-remove-pie.patch
new file mode 100644
index 000000000..63f2efcba
--- /dev/null
+++ b/net/zerotier/patches/0005-remove-pie.patch
@@ -0,0 +1,26 @@
+From 14a8fe1f7cdef1f1e0c0842f6fedde154cf4ab57 Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Thu, 12 Apr 2018 17:09:16 +0200
+Subject: [PATCH 5/5] remove -pie
+
+this prevents immediate segfault on start
+---
+ make-linux.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/make-linux.mk b/make-linux.mk
+index f5b3d8df..8589e5d6 100644
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -67,7 +67,7 @@ else
+ override CFLAGS+=-Wall -fPIE -pthread $(INCLUDES) -DNDEBUG $(DEFS)
+ CXXFLAGS?=-O3 -fstack-protector
+ override CXXFLAGS+=-Wall -Wno-unused-result -Wreorder -fPIE -std=c++11 -pthread $(INCLUDES) -DNDEBUG $(DEFS)
+- override LDFLAGS+=-pie -Wl,-z,relro,-z,now
++ override LDFLAGS+=-Wl,-z,relro,-z,now
+ STRIP?=strip
+ STRIP+=--strip-all
+ endif
+--
+2.16.3
+