From 7a626abf156a9dbac45a14061e5e1a182083a61c Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 28 Oct 2021 12:37:36 -0700 Subject: [PATCH 01/11] remove BondController.cpp from android makefile --- java/jni/Android.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/java/jni/Android.mk b/java/jni/Android.mk index b60fe65e..952bc432 100644 --- a/java/jni/Android.mk +++ b/java/jni/Android.mk @@ -28,7 +28,6 @@ LOCAL_SRC_FILES := \ $(ZT1)/node/AES_aesni.cpp \ $(ZT1)/node/AES_armcrypto.cpp \ $(ZT1)/node/Bond.cpp \ - $(ZT1)/node/BondController.cpp \ $(ZT1)/node/C25519.cpp \ $(ZT1)/node/Capability.cpp \ $(ZT1)/node/CertificateOfMembership.cpp \ From 37f26beb505fa28f5db317c4829c61ef1a4e5930 Mon Sep 17 00:00:00 2001 From: Travis LaDuke Date: Tue, 2 Nov 2021 11:15:10 -0700 Subject: [PATCH 02/11] Fix multicast flag on linux interfaces. When we re-ordered the way the interfaces come up, this flag stopped getting set automatically. see 9374e45449ffe5c377e4cb2a346129ec598eeea9 and github issue #1477 --- RELEASE-NOTES.md | 2 ++ osdep/LinuxEthernetTap.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 22bf76dd..e4096739 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,5 +1,7 @@ ZeroTier Release Notes ====== +# 2021-11-00 -- Version 1.8.2 + * Fix multicast on linux. # 2021-10-28 -- Version 1.8.1 diff --git a/osdep/LinuxEthernetTap.cpp b/osdep/LinuxEthernetTap.cpp index acf97268..181c558b 100644 --- a/osdep/LinuxEthernetTap.cpp +++ b/osdep/LinuxEthernetTap.cpp @@ -213,6 +213,7 @@ LinuxEthernetTap::LinuxEthernetTap( return; } + ifr.ifr_flags |= IFF_MULTICAST; ifr.ifr_flags |= IFF_UP; if (ioctl(sock,SIOCSIFFLAGS,(void *)&ifr) < 0) { ::close(sock); From c7109c646a4202d924d8239a8210a9151757b2b6 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Fri, 5 Nov 2021 16:52:16 -0700 Subject: [PATCH 03/11] Add IA32 build flag --- make-linux.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/make-linux.mk b/make-linux.mk index 324344b3..e35a8237 100644 --- a/make-linux.mk +++ b/make-linux.mk @@ -245,6 +245,13 @@ ERR=$(error FATAL: architecture could not be determined from $(CC) -dumpmachine: err: ; $(ERR) endif +# Flag for Intel 32-bit processors since some machine images are incorrectly marked as i386 +ifeq ($(ZT_IA32),1) + override LDFLAGS+=-m32 + override CFLAGS+=-m32 + override CXXFLAGS+=-m32 +endif + # Disable software updates by default on Linux since that is normally done with package management override DEFS+=-DZT_BUILD_PLATFORM=1 -DZT_BUILD_ARCHITECTURE=$(ZT_ARCHITECTURE) -DZT_SOFTWARE_UPDATE_DEFAULT="\"disable\"" From 62ce6e6a605d6e53c101b59c9bb8652d4db39480 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Fri, 5 Nov 2021 19:38:11 -0700 Subject: [PATCH 04/11] Disable faster x64 crypto mode for IA32 builds --- make-linux.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/make-linux.mk b/make-linux.mk index e35a8237..5ad9120c 100644 --- a/make-linux.mk +++ b/make-linux.mk @@ -250,6 +250,9 @@ ifeq ($(ZT_IA32),1) override LDFLAGS+=-m32 override CFLAGS+=-m32 override CXXFLAGS+=-m32 + # Prevent the use of X64 crypto + ZT_USE_X64_ASM_SALSA=0 + ZT_USE_X64_ASM_ED25519=0 endif # Disable software updates by default on Linux since that is normally done with package management From c15890b4dbba6f6f4385909fc4f3cf3ec54515ef Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 9 Nov 2021 09:31:52 -0500 Subject: [PATCH 05/11] Version bump to 1.8.2. --- RELEASE-NOTES.md | 4 +++- debian/changelog | 6 ++++++ ext/installfiles/mac/ZeroTier One.pkgproj | 2 +- version.h | 2 +- zerotier-one.spec | 5 ++++- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index e4096739..9785cc43 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,7 +1,9 @@ ZeroTier Release Notes ====== -# 2021-11-00 -- Version 1.8.2 +# 2021-11-08 -- Version 1.8.2 + * Fix multicast on linux. + * Update build flags to possibly support MacOS older than 10.14, but more work needs to be done. # 2021-10-28 -- Version 1.8.1 diff --git a/debian/changelog b/debian/changelog index ce6a6d48..a6a24d9b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +zerotier-one (1.8.2) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 08 Nov 2021 01:00:00 -0700 + zerotier-one (1.8.1) unstable; urgency=medium * See RELEASE-NOTES.md for release notes. diff --git a/ext/installfiles/mac/ZeroTier One.pkgproj b/ext/installfiles/mac/ZeroTier One.pkgproj index 60b30ca4..55961ddc 100755 --- a/ext/installfiles/mac/ZeroTier One.pkgproj +++ b/ext/installfiles/mac/ZeroTier One.pkgproj @@ -701,7 +701,7 @@ USE_HFS+_COMPRESSION VERSION - 1.8.1 + 1.8.2 TYPE 0 diff --git a/version.h b/version.h index 3e517241..bb74e0fe 100644 --- a/version.h +++ b/version.h @@ -27,7 +27,7 @@ /** * Revision */ -#define ZEROTIER_ONE_VERSION_REVISION 1 +#define ZEROTIER_ONE_VERSION_REVISION 2 /** * Build version diff --git a/zerotier-one.spec b/zerotier-one.spec index 116b904d..d6ddb83b 100644 --- a/zerotier-one.spec +++ b/zerotier-one.spec @@ -1,5 +1,5 @@ Name: zerotier-one -Version: 1.8.1 +Version: 1.8.2 Release: 1%{?dist} Summary: ZeroTier network virtualization service @@ -152,6 +152,9 @@ esac %endif %changelog +* Mon Nov 08 2021 Adam Ierymenko - 1.8.2 +- see https://github.com/zerotier/ZeroTierOne for release notes + * Wed Oct 20 2021 Adam Ierymenko - 1.8.1 - see https://github.com/zerotier/ZeroTierOne for release notes From 357e1aca544563f107e50d98b1e8f509a8178dc3 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 9 Nov 2021 13:24:03 -0500 Subject: [PATCH 06/11] Likely MAC fix for Linux. --- osdep/LinuxEthernetTap.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/osdep/LinuxEthernetTap.cpp b/osdep/LinuxEthernetTap.cpp index 181c558b..a4c6544e 100644 --- a/osdep/LinuxEthernetTap.cpp +++ b/osdep/LinuxEthernetTap.cpp @@ -205,14 +205,6 @@ LinuxEthernetTap::LinuxEthernetTap( return; } - ifr.ifr_ifru.ifru_hwaddr.sa_family = ARPHRD_ETHER; - _mac.copyTo(ifr.ifr_ifru.ifru_hwaddr.sa_data,6); - if (ioctl(sock,SIOCSIFHWADDR,(void *)&ifr) < 0) { - ::close(sock); - printf("WARNING: ioctl() failed setting up Linux tap device (set MAC)\n"); - return; - } - ifr.ifr_flags |= IFF_MULTICAST; ifr.ifr_flags |= IFF_UP; if (ioctl(sock,SIOCSIFFLAGS,(void *)&ifr) < 0) { @@ -225,7 +217,15 @@ LinuxEthernetTap::LinuxEthernetTap( // before they will accept MTU and MAC. For others it doesn't matter, but is // harmless. This was moved to the worker thread though so as not to block the // main ZeroTier loop. - usleep(500000); + usleep(200000); + + ifr.ifr_ifru.ifru_hwaddr.sa_family = ARPHRD_ETHER; + _mac.copyTo(ifr.ifr_ifru.ifru_hwaddr.sa_data,6); + if (ioctl(sock,SIOCSIFHWADDR,(void *)&ifr) < 0) { + ::close(sock); + printf("WARNING: ioctl() failed setting up Linux tap device (set MAC)\n"); + return; + } ifr.ifr_ifru.ifru_mtu = (int)_mtu; if (ioctl(sock,SIOCSIFMTU,(void *)&ifr) < 0) { From c16b03c8b871932120aaff002789453e58934e98 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 9 Nov 2021 13:28:15 -0500 Subject: [PATCH 07/11] Set MAC address twice, once before and once after bringing interface up, since different kernels behave differently (Linux). --- osdep/LinuxEthernetTap.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/osdep/LinuxEthernetTap.cpp b/osdep/LinuxEthernetTap.cpp index a4c6544e..35a12387 100644 --- a/osdep/LinuxEthernetTap.cpp +++ b/osdep/LinuxEthernetTap.cpp @@ -205,6 +205,16 @@ LinuxEthernetTap::LinuxEthernetTap( return; } + ifr.ifr_ifru.ifru_hwaddr.sa_family = ARPHRD_ETHER; + _mac.copyTo(ifr.ifr_ifru.ifru_hwaddr.sa_data,6); + if (ioctl(sock,SIOCSIFHWADDR,(void *)&ifr) < 0) { + ::close(sock); + printf("WARNING: ioctl() failed setting up Linux tap device (set MAC)\n"); + return; + } + + usleep(100000); + ifr.ifr_flags |= IFF_MULTICAST; ifr.ifr_flags |= IFF_UP; if (ioctl(sock,SIOCSIFFLAGS,(void *)&ifr) < 0) { @@ -213,11 +223,7 @@ LinuxEthernetTap::LinuxEthernetTap( return; } - // Some kernel versions seem to require you to yield while the device comes up - // before they will accept MTU and MAC. For others it doesn't matter, but is - // harmless. This was moved to the worker thread though so as not to block the - // main ZeroTier loop. - usleep(200000); + usleep(100000); ifr.ifr_ifru.ifru_hwaddr.sa_family = ARPHRD_ETHER; _mac.copyTo(ifr.ifr_ifru.ifru_hwaddr.sa_data,6); From f7dbd050af8daafc820775d64b312770d38cfa35 Mon Sep 17 00:00:00 2001 From: capruro Date: Tue, 9 Nov 2021 19:33:11 +0100 Subject: [PATCH 08/11] snapcraft --- .gitignore | 13 +++++++++ snap/snapcraft.yaml | 70 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 snap/snapcraft.yaml diff --git a/.gitignore b/.gitignore index 2143346f..cb91b8a6 100755 --- a/.gitignore +++ b/.gitignore @@ -122,3 +122,16 @@ attic/world/*.c25519 attic/world/mkworld workspace/ workspace2/ + +#snapcraft specifics +/parts/ +/stage/ +/prime/ + +*.snap + +.snapcraft +__pycache__ +*.pyc +*_source.tar.bz2 +snap/.snapcraft \ No newline at end of file diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 00000000..47adc59e --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,70 @@ +name: zerotier +summary: ZeroTier is a software-based managed Ethernet switch for planet Earth. +description: | + It erases the LAN/WAN distinction and makes VPNs, tunnels, proxies, and other kludges arising from the inflexible nature of physical networks obsolete. Everything is encrypted end-to-end and traffic takes the most direct (peer to peer) path available. + This snap contains ZeroTier One, a service that provides ZeroTier network connectivity and makes joining virtual networks as easy as joining IRC or Slack channels. + Visit ZeroTier's site for more information and pre-built binary packages. Apps for Android and iOS are available for free in the Google Play and Apple app stores. + Install + sudo snap install zerotier + Join your network + sudo zerotier.cli join 8056c2e21c000001 + sudo zerotier.cli status + Approve your new node in ZeroTier Central (https://my.zerotier.com)! Welcome online! + +adopt-info: one +confinement: strict +grade: stable +base: core18 + +apps: + one: + # Add -U to prevent attempting to drop privileges since snaps have their + # own containment mechanism. Otherwise, if a user named "zerotier-one" + # exists on the system, the setgid or related calls will fail. + command: usr/sbin/zerotier-one -U + daemon: simple + plugs: + - network + - network-bind + - network-control + + cli: + command: usr/sbin/zerotier-cli + plugs: + - network + + idtool: + command: usr/sbin/zerotier-idtool + plugs: + - network + +layout: + /var/lib/zerotier-one: + bind: $SNAP_COMMON + +parts: + one: + plugin: make + source: . + source-type: git + build-packages: + - build-essential + - libc++-dev + make-parameters: + - CXX=g++ + filesets: + binaries: + - usr/sbin/zerotier-one + - usr/sbin/zerotier-cli + - usr/sbin/zerotier-idtool + prime: + - $binaries + override-build: | + snapcraftctl build + # Grab the version string from the newly-compiled binary. + snapcraftctl set-version "$(./zerotier-one -v)" +slots: + zerotier-control: + interface: content + read: + - $SNAP_COMMON \ No newline at end of file From cacfc294d9851ee74109f803165daabacc2ad25e Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 10 Nov 2021 20:04:36 -0500 Subject: [PATCH 09/11] Windows package version bump and PATH fix. --- ext/installfiles/windows/ZeroTier One.aip | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/installfiles/windows/ZeroTier One.aip b/ext/installfiles/windows/ZeroTier One.aip index 8f220d1f..4542e8c2 100644 --- a/ext/installfiles/windows/ZeroTier One.aip +++ b/ext/installfiles/windows/ZeroTier One.aip @@ -26,10 +26,10 @@ - + - + @@ -64,7 +64,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -510,7 +510,7 @@ - + From 953d22de14a9c29c0eac5a69d899ce0ab252de2f Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 10 Nov 2021 22:18:35 -0500 Subject: [PATCH 10/11] VERSION 1.8.2 --- RELEASE-NOTES.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 9785cc43..ffe03aea 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,9 +1,12 @@ ZeroTier Release Notes ====== + # 2021-11-08 -- Version 1.8.2 * Fix multicast on linux. - * Update build flags to possibly support MacOS older than 10.14, but more work needs to be done. + * Fix a bug that could cause the tap adapter to have the wrong MAC on Linux. + * Update build flags to possibly support MacOS older than 10.14, but more work needs to be done. It may not work yet. + * Fix path variable setting on Windows. # 2021-10-28 -- Version 1.8.1