From 93ffd75b02f4605cff5f3c200966d956cb53034f Mon Sep 17 00:00:00 2001 From: Vincent Milum Jr Date: Sat, 21 Nov 2020 13:30:31 -0800 Subject: [PATCH] Add ZT_NO_UNALIGNED_ACCESS for ARMv6/7 on FreeBSD Unaligned access caused SIGBUS errors on ARMv6 and ARMv7 targets under FreeBSD. This was also the cause of the repeating TAP devices. Each time the SIGBUS happened, the service would auto-restart itself, create a new TAP device, and then crash again. The particular place causing the SIGBUS was: https://github.com/zerotier/ZeroTierOne/blob/master/node/Utils.hpp#L695 --- make-bsd.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make-bsd.mk b/make-bsd.mk index da7a60125..06c188090 100644 --- a/make-bsd.mk +++ b/make-bsd.mk @@ -65,7 +65,7 @@ ifeq ($(CC_MACH),armhf) endif ifeq ($(CC_MACH),armv6) ZT_ARCHITECTURE=3 - override DEFS+=-DZT_NO_TYPE_PUNNING + override DEFS+=-DZT_NO_TYPE_PUNNING -DZT_NO_UNALIGNED_ACCESS ZT_USE_ARM32_NEON_ASM_SALSA2012=1 endif ifeq ($(CC_MACH),armv6zk) @@ -80,7 +80,7 @@ ifeq ($(CC_MACH),armv6kz) endif ifeq ($(CC_MACH),armv7) ZT_ARCHITECTURE=3 - override DEFS+=-DZT_NO_TYPE_PUNNING -DZT_AES_NO_ACCEL + override DEFS+=-DZT_NO_TYPE_PUNNING -DZT_AES_NO_ACCEL -DZT_NO_UNALIGNED_ACCESS ZT_USE_ARM32_NEON_ASM_SALSA2012=1 endif ifeq ($(CC_MACH),arm64)