Skip to content
Merged

1.16.1 #2549

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ce5556a
Merge pull request #4 from zerotier/dev-merge-from-public-repo
joseph-henry Nov 4, 2025
f231561
Stop and restart the Prometheus worker thread when daemonizing
cspiegel Nov 4, 2025
b8e3ca6
Merge pull request #7 from zerotier/2279-prometheus-after-daemonize
cspiegel Nov 5, 2025
616698f
Ensure erase() is called after std::unique()
cspiegel Nov 5, 2025
4831189
Allow metrics to be disabled
cspiegel Nov 4, 2025
1d9f06d
Disable metrics by default
cspiegel Nov 6, 2025
fb16208
Fix assignment vs comparison typo
cspiegel Nov 5, 2025
9e53fe4
Avoid using the same source and destination in snprintf()
cspiegel Nov 5, 2025
595a70c
Remove old multipathMode setting
joseph-henry Nov 10, 2025
300b05a
Merge pull request #8 from zerotier/2152-disable-metrics
joseph-henry Nov 10, 2025
8e5d817
Merge pull request #10 from zerotier/windows-bool-assign
joseph-henry Nov 10, 2025
7f5850a
Merge pull request #11 from zerotier/snprintf-into-self
joseph-henry Nov 10, 2025
20007a7
Merge pull request #12 from zerotier/erase-after-unique
cspiegel Nov 10, 2025
4f6b903
Disable debug logging for the HTTP API library
joseph-henry Dec 1, 2025
458c5c9
Merge pull request #21 from zerotier/joseph-henry-disable-http-debug
joseph-henry Dec 1, 2025
2342926
All version bumps but Windows.
adamierymenko Dec 12, 2025
22b47f8
1.16.1 Windows bump
adamierymenko Dec 12, 2025
9c2bd25
Add a couple entries to the release notes
cspiegel Dec 22, 2025
a77009e
notes
adamierymenko Dec 22, 2025
d2b4b6e
Add date to release notes.
adamierymenko Dec 22, 2025
fa60163
Merge branch 'dev' into 1.16.1
adamierymenko Dec 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
ZeroTier Release Notes
======

## 2025-12-22 -- Version 1.16.1

* Metrics collection is now disabled by default. It can be enabled via the `enableMetrics` setting in `local.conf`.
* Fix for an issue where metrics were not being recorded while running in daemon mode.
* Fix debug dumpfile being written to the root directory.
* Minor bug fixes in Mac and BSD tun/tap code.

## 2025-08-21 -- Version 1.16.0

* License Changes
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
zerotier-one (1.16.1) unstable; urgency=medium

* See RELEASE-NOTES.md for release notes.

-- Adam Ierymenko <adam.ierymenko@zerotier.com> Mon, 12 Dec 2025 01:00:00 -0700

zerotier-one (1.16.0-2) unstable; urgency=medium

* Fix build settings to include controller.
Expand Down
2 changes: 1 addition & 1 deletion ext/installfiles/mac/ZeroTier One.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@
<key>USE_HFS+_COMPRESSION</key>
<false />
<key>VERSION</key>
<string>1.16.0</string>
<string>1.16.1</string>
</dict>
<key>TYPE</key>
<integer>0</integer>
Expand Down
8 changes: 4 additions & 4 deletions ext/installfiles/windows/ZeroTier One.aip
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<ROW Property="AiFeatIcoZeroTierOne" Value="ZeroTierIcon.exe" Type="8"/>
<ROW Property="MSIFASTINSTALL" MultiBuildValue="DefaultBuild:2"/>
<ROW Property="Manufacturer" Value="ZeroTier, Inc."/>
<ROW Property="ProductCode" Value="1033:{C805CD5B-45F5-49F7-B428-142396DE03CA} " Type="16"/>
<ROW Property="ProductCode" Value="1033:{83B4ADDB-1653-4B88-AE50-614649687DA9} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="ZeroTier One"/>
<ROW Property="ProductVersion" Value="1.16.0" Options="32"/>
<ROW Property="ProductVersion" Value="1.16.1" Options="32"/>
<ROW Property="REBOOT" MultiBuildValue="DefaultBuild:ReallySuppress"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/>
<ROW Property="UpgradeCode" Value="{B0E2A5F3-88B6-4E77-B922-CB4739B4C4C8}"/>
Expand Down Expand Up @@ -62,7 +62,7 @@
<ROW Directory="regid.201001.com.zerotier_Dir" Directory_Parent="CommonAppDataFolder" DefaultDir="REGID2~1.ZER|regid.2010-01.com.zerotier" DirectoryOptions="12"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
<ROW Component="AI_CustomARPName" ComponentId="{A3752E9B-9B23-4433-B186-24C3C5C4BC4A}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
<ROW Component="AI_CustomARPName" ComponentId="{8633F45B-5725-4FB8-B1B6-D945785D4629}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
<ROW Component="AI_DisableModify" ComponentId="{46FFA8C5-A0CB-4E05-9AD3-911D543DE8CA}" Directory_="APPDIR" Attributes="4" KeyPath="NoModify" Options="1"/>
<ROW Component="AI_ExePath" ComponentId="{8E02B36C-7A19-429B-A93E-77A9261AC918}" Directory_="APPDIR" Attributes="4" KeyPath="AI_ExePath"/>
<ROW Component="APPDIR" ComponentId="{4DD7907D-D7FE-4CD6-B1A0-B5C1625F5133}" Directory_="APPDIR" Attributes="0"/>
Expand Down Expand Up @@ -515,7 +515,7 @@
<ROW XmlAttribute="xsischemaLocation" XmlElement="swidsoftware_identification_tag" Name="xsi:schemaLocation" Flags="14" Order="3" Value="http://standards.iso.org/iso/19770/-2/2008/schema.xsd software_identification_tag.xsd"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.XmlElementComponent">
<ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Condition="1" Order="2" Flags="14" Text="0" UpdateIndexInParent="0"/>
<ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Condition="1" Order="2" Flags="14" Text="1" UpdateIndexInParent="0"/>
<ROW XmlElement="swidentitlement_required_indicator" ParentElement="swidsoftware_identification_tag" Name="swid:entitlement_required_indicator" Condition="1" Order="0" Flags="14" Text="false" UpdateIndexInParent="0"/>
<ROW XmlElement="swidmajor" ParentElement="swidnumeric" Name="swid:major" Condition="1" Order="0" Flags="14" Text="1" UpdateIndexInParent="0"/>
<ROW XmlElement="swidminor" ParentElement="swidnumeric" Name="swid:minor" Condition="1" Order="1" Flags="14" Text="16" UpdateIndexInParent="0"/>
Expand Down
558 changes: 0 additions & 558 deletions ext/installfiles/windows/ZeroTier One.back.aip

This file was deleted.

10 changes: 10 additions & 0 deletions ext/prometheus-cpp-lite-1.0/core/include/prometheus/save_to_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ namespace prometheus {
public:
SaveToFile() = default;

void stop() {
must_die = true;
worker_thread.join();
}

void restart() {
must_die = false;
worker_thread = std::thread(&SaveToFile::worker_function, this);
}

~SaveToFile() {
must_die = true;
worker_thread.join();
Expand Down
34 changes: 21 additions & 13 deletions one.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1196,12 +1196,13 @@ static int cli(int argc, char** argv)
return 0;
}

snprintf((char*)path, sizeof(path), "%s%szerotier_dump.txt", (char*)path, ZT_PATH_SEPARATOR_S);
char dumpfile[PATH_MAX];
snprintf(dumpfile, sizeof(dumpfile), "%s%szerotier_dump.txt", (char*)path, ZT_PATH_SEPARATOR_S);

fprintf(stdout, "Writing dump to: %s\n", path);
int fd = open((char*)path, O_CREAT | O_RDWR, 0664);
fprintf(stdout, "Writing dump to: %s\n", dumpfile);
int fd = open(dumpfile, O_CREAT | O_WRONLY | O_TRUNC, 0664);
if (fd == -1) {
fprintf(stderr, "Error creating file.\n");
perror("Error creating file");
return 1;
}
write(fd, dump.str().c_str(), dump.str().size());
Expand Down Expand Up @@ -1278,9 +1279,9 @@ static int cli(int argc, char** argv)
return 0;
}

BOOL err = WriteFile(file, dump.str().c_str(), dump.str().size(), NULL, NULL);
if (err = FALSE) {
fprintf(stderr, "Error writing file");
BOOL ok = WriteFile(file, dump.str().c_str(), dump.str().size(), NULL, NULL);
if (ok == FALSE) {
fprintf(stderr, "Error writing file\n");
return 1;
}
CloseHandle(file);
Expand Down Expand Up @@ -1346,12 +1347,15 @@ static int cli(int argc, char** argv)
}
close(sock);
char cwd[16384];
getcwd(cwd, sizeof(cwd));
snprintf(cwd, sizeof(cwd), "%s%szerotier_dump.txt", cwd, ZT_PATH_SEPARATOR_S);
fprintf(stdout, "Writing dump to: %s\n", cwd);
int fd = open(cwd, O_CREAT | O_RDWR, 0664);
if (getcwd(cwd, sizeof(cwd)) == nullptr) {
strcpy(cwd, ".");
}
char dumpfile[sizeof(cwd) + 32];
snprintf(dumpfile, sizeof(dumpfile), "%s%szerotier_dump.txt", cwd, ZT_PATH_SEPARATOR_S);
fprintf(stdout, "Writing dump to: %s\n", dumpfile);
int fd = open(dumpfile, O_CREAT | O_WRONLY | O_TRUNC, 0664);
if (fd == -1) {
fprintf(stderr, "Error creating file.\n");
perror("Error creating file");
return 1;
}
write(fd, dump.str().c_str(), dump.str().size());
Expand Down Expand Up @@ -2330,14 +2334,18 @@ int main(int argc, char** argv)
}
#endif // !ZT_ONE_NO_ROOT_CHECK
if (runAsDaemon) {
prometheus::simpleapi::saver.stop();

long p = (long)fork();
if (p < 0) {
fprintf(stderr, "%s: could not fork" ZT_EOL_S, argv[0]);
return 1;
}
else if (p > 0)
return 0; // forked
_Exit(0); // forked
// else p == 0, so we are daemonized

prometheus::simpleapi::saver.restart();
}
#endif // __UNIX_LIKE__

Expand Down
4 changes: 2 additions & 2 deletions osdep/BSDEthernetTap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ std::vector<InetAddress> BSDEthernetTap::ips() const
freeifaddrs(ifa);

std::sort(r.begin(), r.end());
std::unique(r.begin(), r.end());
r.erase(std::unique(r.begin(), r.end()), r.end());

_ifaddrs = r;

Expand Down Expand Up @@ -394,7 +394,7 @@ void BSDEthernetTap::scanMulticastGroups(std::vector<MulticastGroup>& added, std
newGroups.push_back(MulticastGroup::deriveMulticastGroupForAddressResolution(*ip));

std::sort(newGroups.begin(), newGroups.end());
std::unique(newGroups.begin(), newGroups.end());
newGroups.erase(std::unique(newGroups.begin(), newGroups.end()), newGroups.end());

for (std::vector<MulticastGroup>::iterator m(newGroups.begin()); m != newGroups.end(); ++m) {
if (! std::binary_search(_multicastGroups.begin(), _multicastGroups.end(), *m))
Expand Down
2 changes: 1 addition & 1 deletion osdep/MacKextEthernetTap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ void MacKextEthernetTap::scanMulticastGroups(std::vector<MulticastGroup>& added,
newGroups.push_back(MulticastGroup::deriveMulticastGroupForAddressResolution(*ip));

std::sort(newGroups.begin(), newGroups.end());
std::unique(newGroups.begin(), newGroups.end());
newGroups.erase(std::unique(newGroups.begin(), newGroups.end()), newGroups.end());

for (std::vector<MulticastGroup>::iterator m(newGroups.begin()); m != newGroups.end(); ++m) {
if (! std::binary_search(_multicastGroups.begin(), _multicastGroups.end(), *m))
Expand Down
4 changes: 2 additions & 2 deletions osdep/NetBSDEthernetTap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ std::vector<InetAddress> NetBSDEthernetTap::ips() const
freeifaddrs(ifa);

std::sort(r.begin(), r.end());
std::unique(r.begin(), r.end());
r.erase(std::unique(r.begin(), r.end()), r.end());

return r;
}
Expand Down Expand Up @@ -367,7 +367,7 @@ void NetBSDEthernetTap::scanMulticastGroups(std::vector<MulticastGroup>& added,
newGroups.push_back(MulticastGroup::deriveMulticastGroupForAddressResolution(*ip));

std::sort(newGroups.begin(), newGroups.end());
std::unique(newGroups.begin(), newGroups.end());
newGroups.erase(std::unique(newGroups.begin(), newGroups.end()), newGroups.end());

for (std::vector<MulticastGroup>::iterator m(newGroups.begin()); m != newGroups.end(); ++m) {
if (! std::binary_search(_multicastGroups.begin(), _multicastGroups.end(), *m))
Expand Down
14 changes: 11 additions & 3 deletions service/OneService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,6 @@ class OneServiceImpl : public OneService {
_ports[1] = 0;
_ports[2] = 0;

prometheus::simpleapi::saver.set_registry(prometheus::simpleapi::registry_ptr);
prometheus::simpleapi::saver.set_delay(std::chrono::seconds(5));
prometheus::simpleapi::saver.set_out_file(_homePath + ZT_PATH_SEPARATOR + "metrics.prom");

Expand Down Expand Up @@ -2610,8 +2609,8 @@ class OneServiceImpl : public OneService {
_controlPlaneV6.set_pre_routing_handler(authCheck);

#if ZT_DEBUG == 1
_controlPlane.set_logger([](const httplib::Request& req, const httplib::Response& res) { fprintf(stderr, "%s", http_log(req, res).c_str()); });
_controlPlaneV6.set_logger([](const httplib::Request& req, const httplib::Response& res) { fprintf(stderr, "%s", http_log(req, res).c_str()); });
//_controlPlane.set_logger([](const httplib::Request& req, const httplib::Response& res) { fprintf(stderr, "%s", http_log(req, res).c_str()); });
//_controlPlaneV6.set_logger([](const httplib::Request& req, const httplib::Response& res) { fprintf(stderr, "%s", http_log(req, res).c_str()); });
#endif
if (_primaryPort == 0) {
fprintf(stderr, "unable to determine local control port");
Expand Down Expand Up @@ -2931,6 +2930,15 @@ class OneServiceImpl : public OneService {
_allowManagementFrom.push_back(nw);
}
}

bool enableMetrics = OSUtils::jsonBool(settings["enableMetrics"], false);
if (enableMetrics) {
prometheus::simpleapi::saver.set_registry(prometheus::simpleapi::registry_ptr);
}
else {
std::shared_ptr<prometheus::Registry> registry;
prometheus::simpleapi::saver.set_registry(registry);
}
}

#if ZT_VAULT_SUPPORT
Expand Down
2 changes: 1 addition & 1 deletion service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Settings available in `local.conf` (this is not valid JSON, and JSON does not al
"allowManagementFrom": [ "NETWORK/bits", ...] |null, /* If non-NULL, allow JSON/HTTP management from this IP network. Default is 127.0.0.1 only. */
"bind": [ "ip",... ], /* If present and non-null, bind to these IPs instead of to each interface (wildcard IP allowed) */
"allowTcpFallbackRelay": true|false, /* Allow or disallow establishment of TCP relay connections (true by default) */
"multipathMode": 0|1|2 /* multipath mode: none (0), random (1), proportional (2) */
"enableMetrics": true|false /* If true, enable the collection of metrics in metrics.prom. */
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* Revision
*/
#define ZEROTIER_ONE_VERSION_REVISION 0
#define ZEROTIER_ONE_VERSION_REVISION 1

/**
* Build version
Expand Down
5 changes: 4 additions & 1 deletion zerotier-one.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: zerotier-one
Version: 1.16.0
Version: 1.16.1
Release: 1%{?dist}
Summary: ZeroTier network virtualization service

Expand Down Expand Up @@ -155,6 +155,9 @@ chmod 0755 $RPM_BUILD_ROOT/etc/init.d/zerotier-one
%endif

%changelog
* Fri Dec 12 2025 Adam Ierymenko <adam.ierymenko@zerotier.com> - 1.16.1
- see https://github.com/zerotier/ZeroTierOne for release notes

* Wed Oct 23 2024 Adam Ierymenko <adam.ierymenko@zerotier.com> - 1.14.2
- see https://github.com/zerotier/ZeroTierOne for release notes

Expand Down
Loading