From bfe5c758ba38ab453e1f450738d09855c91e66d2 Mon Sep 17 00:00:00 2001 From: Robert Socha Date: Sat, 18 Apr 2020 18:56:28 +0200 Subject: [PATCH 01/10] Add description for Windos service --- windows/ZeroTierOne/ServiceInstaller.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/windows/ZeroTierOne/ServiceInstaller.cpp b/windows/ZeroTierOne/ServiceInstaller.cpp index d302d9f62..ef7007477 100644 --- a/windows/ZeroTierOne/ServiceInstaller.cpp +++ b/windows/ZeroTierOne/ServiceInstaller.cpp @@ -53,6 +53,8 @@ std::string InstallService(PSTR pszServiceName, char szPathTmp[MAX_PATH],szPath[MAX_PATH]; SC_HANDLE schSCManager = NULL; SC_HANDLE schService = NULL; + SERVICE_DESCRIPTION sd; + LPTSTR szDesc = TEXT("Provides secure encrypted communications between hosts over an insecure networks."); if (GetModuleFileName(NULL, szPathTmp, ARRAYSIZE(szPath)) == 0) { @@ -77,7 +79,7 @@ std::string InstallService(PSTR pszServiceName, schSCManager, // SCManager database pszServiceName, // Name of service pszDisplayName, // Name to display - SERVICE_QUERY_STATUS, // Desired access + SERVICE_ALL_ACCESS, // Desired access SERVICE_WIN32_OWN_PROCESS, // Service type dwStartType, // Service start type SERVICE_ERROR_NORMAL, // Error control type @@ -94,6 +96,11 @@ std::string InstallService(PSTR pszServiceName, goto Cleanup; } + // Setup service description + sd.lpDescription = szDesc; + if (!ChangeServiceConfig2(schService, SERVICE_CONFIG_DESCRIPTION, &sd)) { + ret = "CreateService failed (description)"; + } Cleanup: // Centralized cleanup for all allocated resources. if (schSCManager) From 2aecb547d99e6a711859956a71dafa28a87ed97b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 20 Dec 2019 19:35:41 -0800 Subject: [PATCH 02/10] LinuxNetLink: Add cerrno header for (str)errno Fixes compilation under libcxx. --- osdep/LinuxNetLink.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osdep/LinuxNetLink.cpp b/osdep/LinuxNetLink.cpp index 421da1f63..b0f2d84fb 100644 --- a/osdep/LinuxNetLink.cpp +++ b/osdep/LinuxNetLink.cpp @@ -13,6 +13,8 @@ #include "../node/Constants.hpp" +#include + //#define ZT_NETLINK_TRACE #ifdef __LINUX__ From 567969d33cb41b3d9214fea4a0060d05e8d0bd39 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 4 Mar 2022 14:54:51 -0500 Subject: [PATCH 03/10] 1.8.6 with a UI non-responsiveness fix. --- RELEASE-NOTES.md | 6 ++++++ service/OneService.cpp | 46 ++++++++++++++++++------------------------ version.h | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 7fc7cb761..70eda898f 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,12 +1,18 @@ ZeroTier Release Notes ====== +# 2022-03-04 -- Version 1.8.6 + + * Fixed an issue that could cause the UI to be non-responsive if not joined to any networks. + * Fix dependency issues in Debian and RedHat packages for some distributions (Fedora, Mint). + # 2022-02-22 -- Version 1.8.5 * Plumbing under the hood for endpoint device SSO support. * Fix in LinuxEthernetTap to tap device support on very old (2.6) Linux kernels. * Fix an issue that could cause self-hosted roots ("moons") to fail to assist peers in making direct links. (GitHub issue #1512) * Merge a series of changes by Joseph Henry (of ZeroTier) that should fix some edge cases where ZeroTier would "forget" valid paths. + * Minor multipath improvements for automatic path negotiation. # 2021-11-30 -- Version 1.8.4 diff --git a/service/OneService.cpp b/service/OneService.cpp index 73b3a9d56..f8ecb6823 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -1579,37 +1579,31 @@ public: } } else if (ps[0] == "network") { Mutex::Lock _l(_nets_m); - if (!_nets.empty()) { - if (ps.size() == 1) { - // Return [array] of all networks + if (ps.size() == 1) { + // Return [array] of all networks - res = nlohmann::json::array(); - - for (auto it = _nets.begin(); it != _nets.end(); ++it) { - NetworkState &ns = it->second; - nlohmann::json nj; - _networkToJson(nj, ns); - res.push_back(nj); - } + res = nlohmann::json::array(); + for (auto it = _nets.begin(); it != _nets.end(); ++it) { + NetworkState &ns = it->second; + nlohmann::json nj; + _networkToJson(nj, ns); + res.push_back(nj); + } + + scode = 200; + } else if (ps.size() == 2) { + // Return a single network by ID or 404 if not found + + const uint64_t wantnw = Utils::hexStrToU64(ps[1].c_str()); + if (_nets.find(wantnw) != _nets.end()) { + res = json::object(); + NetworkState& ns = _nets[wantnw]; + _networkToJson(res, ns); scode = 200; - } else if (ps.size() == 2) { - // Return a single network by ID or 404 if not found - - const uint64_t wantnw = Utils::hexStrToU64(ps[1].c_str()); - if (_nets.find(wantnw) != _nets.end()) { - res = json::object(); - NetworkState& ns = _nets[wantnw]; - _networkToJson(res, ns); - scode = 200; - } - } else { - fprintf(stderr, "not found\n"); - scode = 404; } } else { - fprintf(stderr, "_nets is empty??\n"); - scode = 500; + scode = 404; } } else if (ps[0] == "peer") { ZT_PeerList *pl = _node->peers(); diff --git a/version.h b/version.h index e4e7e4cc4..9b311bb12 100644 --- a/version.h +++ b/version.h @@ -27,7 +27,7 @@ /** * Revision */ -#define ZEROTIER_ONE_VERSION_REVISION 5 +#define ZEROTIER_ONE_VERSION_REVISION 6 /** * Build version From a8dde7b89b04071a7523096260791d1e406587d8 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Fri, 4 Mar 2022 14:28:25 -0800 Subject: [PATCH 04/10] update JNI to add new status code --- java/jni/ZT_jniutils.cpp | 3 +++ java/src/com/zerotier/sdk/VirtualNetworkStatus.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/java/jni/ZT_jniutils.cpp b/java/jni/ZT_jniutils.cpp index b66249577..bcbd31916 100644 --- a/java/jni/ZT_jniutils.cpp +++ b/java/jni/ZT_jniutils.cpp @@ -117,6 +117,9 @@ jobject createVirtualNetworkStatus(JNIEnv *env, ZT_VirtualNetworkStatus status) case ZT_NETWORK_STATUS_OK: fieldName = "NETWORK_STATUS_OK"; break; + case ZT_NETWORK_STATUS_AUTHENTICATION_REQUIRED: + fieldName = "NETWORK_STATUS_AUTHENTICATION_REQUIRED"; + break; case ZT_NETWORK_STATUS_ACCESS_DENIED: fieldName = "NETWORK_STATUS_ACCESS_DENIED"; break; diff --git a/java/src/com/zerotier/sdk/VirtualNetworkStatus.java b/java/src/com/zerotier/sdk/VirtualNetworkStatus.java index 2d00561a1..68e01bd61 100644 --- a/java/src/com/zerotier/sdk/VirtualNetworkStatus.java +++ b/java/src/com/zerotier/sdk/VirtualNetworkStatus.java @@ -37,6 +37,11 @@ public enum VirtualNetworkStatus { */ NETWORK_STATUS_OK, + /** + * Netconf master said SSO auth required. + */ + NETWORK_STATUS_AUTHENTICATION_REQUIRED, + /** * Netconf master told us 'nope' */ From e1a328527342d69f86a394dec6702865a7db22fa Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 7 Mar 2022 13:52:05 -0500 Subject: [PATCH 05/10] Update ServiceInstaller.cpp Some very minor changes to this PR --- windows/ZeroTierOne/ServiceInstaller.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/windows/ZeroTierOne/ServiceInstaller.cpp b/windows/ZeroTierOne/ServiceInstaller.cpp index ef7007477..05a78002e 100644 --- a/windows/ZeroTierOne/ServiceInstaller.cpp +++ b/windows/ZeroTierOne/ServiceInstaller.cpp @@ -54,7 +54,7 @@ std::string InstallService(PSTR pszServiceName, SC_HANDLE schSCManager = NULL; SC_HANDLE schService = NULL; SERVICE_DESCRIPTION sd; - LPTSTR szDesc = TEXT("Provides secure encrypted communications between hosts over an insecure networks."); + LPTSTR szDesc = TEXT("ZeroTier network virtualization service."); if (GetModuleFileName(NULL, szPathTmp, ARRAYSIZE(szPath)) == 0) { @@ -98,9 +98,7 @@ std::string InstallService(PSTR pszServiceName, // Setup service description sd.lpDescription = szDesc; - if (!ChangeServiceConfig2(schService, SERVICE_CONFIG_DESCRIPTION, &sd)) { - ret = "CreateService failed (description)"; - } + ChangeServiceConfig2(schService, SERVICE_CONFIG_DESCRIPTION, &sd); Cleanup: // Centralized cleanup for all allocated resources. if (schSCManager) From 6bfaaaa557adf20fb09182f9d67829961b96248e Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 7 Mar 2022 14:06:12 -0500 Subject: [PATCH 06/10] 1.8.6 bump and add AutoReqProv:no for GitHub issue #1575 --- zerotier-one.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zerotier-one.spec b/zerotier-one.spec index b5f2e42f7..1687bb359 100644 --- a/zerotier-one.spec +++ b/zerotier-one.spec @@ -15,6 +15,7 @@ BuildRequires: systemd %endif Requires: iproute libstdc++ openssl +AutoReqProv: no %if 0%{?rhel} >= 7 Requires: systemd @@ -164,6 +165,9 @@ esac %endif %changelog +* Fri Mar 07 2022 Adam Ierymenko - 1.8.6 +- see https://github.com/zerotier/ZeroTierOne for release notes + * Fri Dec 17 2021 Adam Ierymenko - 1.8.5 - see https://github.com/zerotier/ZeroTierOne for release notes From 8624972d0190bfafaa565c26736045453836fe0f Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 8 Mar 2022 09:17:14 -0500 Subject: [PATCH 07/10] More 1.8.6 bumps. --- debian/changelog | 6 ++++++ ext/installfiles/mac/ZeroTier One.pkgproj | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f9ff08746..512be8445 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +zerotier-one (1.8.6) unstable; urgency=medium + + * See RELEASE-NOTES.md for release notes. + + -- Adam Ierymenko Mon, 07 Mar 2022 01:00:00 -0700 + zerotier-one (1.8.5) 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 c4ca48901..48af67b37 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.5 + 1.8.6 TYPE 0 From 4bdf0317c3a3cc387d4df7b63ae59b36f910db67 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 8 Mar 2022 15:18:57 -0500 Subject: [PATCH 08/10] Forgot to version bump RH. --- zerotier-one.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerotier-one.spec b/zerotier-one.spec index 1687bb359..483de24db 100644 --- a/zerotier-one.spec +++ b/zerotier-one.spec @@ -1,5 +1,5 @@ Name: zerotier-one -Version: 1.8.5 +Version: 1.8.6 Release: 1%{?dist} Summary: ZeroTier network virtualization service From 34a64f30de711a420ff0fd51cd3ddf2edc282122 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 9 Mar 2022 09:13:26 -0500 Subject: [PATCH 09/10] Bump the peer cache serialization version due to path changes, will cause peers to be re-learned. Technically the peer cache is optional anyway so it's not going to break anything and should guard against weird issues due to path learning changes on restart. --- node/Peer.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/Peer.hpp b/node/Peer.hpp index 3bfe31950..11e084baf 100644 --- a/node/Peer.hpp +++ b/node/Peer.hpp @@ -438,7 +438,7 @@ public: template inline void serializeForCache(Buffer &b) const { - b.append((uint8_t)1); + b.append((uint8_t)2); _id.serialize(b); @@ -466,7 +466,7 @@ public: { try { unsigned int ptr = 0; - if (b[ptr++] != 1) + if (b[ptr++] != 2) return SharedPtr(); Identity id; From 4a2c75a60941e75f36ed1961458a42fbd12ea4ac Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 10 Mar 2022 13:36:31 -0500 Subject: [PATCH 10/10] Release notes --- RELEASE-NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 70eda898f..4f810b5df 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -5,6 +5,7 @@ ZeroTier Release Notes * Fixed an issue that could cause the UI to be non-responsive if not joined to any networks. * Fix dependency issues in Debian and RedHat packages for some distributions (Fedora, Mint). + * Bumped the peer cache serialization version to prevent "coma" issues on upgrade due to changes in path logic behaving badly with old values. # 2022-02-22 -- Version 1.8.5