Commit graph

159 commits

Author SHA1 Message Date
Joseph Henry
7f5850a943
Merge pull request #11 from zerotier/snprintf-into-self
Avoid using the same source and destination in snprintf()
2025-11-10 09:50:22 -08:00
Chris Spiegel
9e53fe4b12 Avoid using the same source and destination in snprintf()
It's undefined to write to a buffer you're reading from in snprintf().
On modern glibc and musl versions, this results in the string
"/zerotier_dump.txt" being generated, i.e. in the root directory. Use a
new variable to hold the string dump.

This is done for MacOS as well. On Sequoia, at least, it's not
necessary, as it handles overlapping objects fine, but this is more
future-proof.

At the same time, include a specific error message when the dumpfile
can't be opened to help users track down problems. Also, truncate the
file so that new writes don't potentially leave stale data.
2025-11-06 08:28:33 -08:00
Chris Spiegel
fb162084f5 Fix assignment vs comparison typo
At the same time, ensure a newline is written after the error message.
2025-11-06 05:24:56 -08:00
Chris Spiegel
f231561276 Stop and restart the Prometheus worker thread when daemonizing
Also use _Exit() instead of returning from main() to avoid duplicate
cleanup/flusing/etc.
2025-11-05 14:15:47 -08:00
Adam Ierymenko
a4d762d404
messages for non-free builds 2025-09-05 15:39:47 -04:00
Adam Ierymenko
ca4e35d52c
License stuff, version bump, CLI output. 2025-08-21 11:01:52 -04:00
Adam Ierymenko
3e21edb891
Remove a bunch of warnings by eliminating deprecated functions. 2025-08-21 10:06:56 -04:00
Adam Ierymenko
c21636b295
Remove moon comments from the CLI help. They still work but are not shown. 2025-08-11 13:22:39 -04:00
Adam Ierymenko
e22c80dce6
Merge branch 'dev' into dev-extosdep 2025-07-08 16:41:46 -04:00
Adam Ierymenko
16dd3fd7af Windows build fixes from clang-format, disable for Windows include order 2025-07-08 15:11:57 -04:00
Joseph Henry
cd191778c2
Add custom management plane for 3rd party vendors 2025-02-26 10:27:23 -08:00
Adam Ierymenko
307befa892
Rename C25519.* to ECC.* 2024-09-15 17:34:01 -04:00
Adam Ierymenko
7647c8e8d1
Rename ECC key and signature size defines to be generic. 2024-09-15 16:33:41 -04:00
Adam Ierymenko
1982071d46 1.14.0 version bump for Linux and macOS, date update. 2024-03-19 14:38:48 -07:00
Joseph Henry
bbe97dd080
Improve CLI error handling for setmtu command 2024-03-05 00:13:07 -08:00
Joseph Henry
2e6cda38f6
Port multipath improvements to newer version 2024-03-01 15:43:28 -08:00
Brenton Bostick
a477688e51 Remove extra '/'
On macOS, dump gives this output:
% sudo zerotier-cli dump
Writing dump to: /Users/brenton/Desktop//zerotier_dump.txt

No reason for extra '/' in path
2023-11-06 09:32:35 -05:00
Joseph Henry
b8b5d0bff8
Add setmtu command, fix bond lifetime issue 2023-08-15 12:59:58 -07:00
Adam Ierymenko
1c5897895b
1.10.4 merge into main (#1893)
* add note about forceTcpRelay

* Create a sample systemd unit for tcp proxy

* set gitattributes for rust & cargo so hashes dont conflict on Windows

* Revert "set gitattributes for rust & cargo so hashes dont conflict on Windows"

This reverts commit 032dc5c108.

* Turn off autocrlf for rust source

Doesn't appear to play nice well when it comes to git and vendored cargo package hashes

* Fix #1883 (#1886)

Still unknown as to why, but the call to `nc->GetProperties()` can fail
when setting a friendly name on the Windows virtual ethernet adapter.
Ensure that `ncp` is not null before continuing and accessing the device
GUID.

* Don't vendor packages for zeroidc (#1885)

* Added docker environment way to join networks (#1871)

* add StringUtils

* fix headers
use recommended headers and remove unused headers

* move extern "C"
only JNI functions need to be exported

* cleanup

* fix ANDROID-50: RESULT_ERROR_BAD_PARAMETER typo

* fix typo in log message

* fix typos in JNI method signatures

* fix typo

* fix ANDROID-51: fieldName is uninitialized

* fix ANDROID-35: memory leak

* fix missing DeleteLocalRef in loops

* update to use unique error codes

* add GETENV macro

* add LOG_TAG defines

* ANDROID-48: add ZT_jnicache.cpp

* ANDROID-48: use ZT_jnicache.cpp and remove ZT_jnilookup.cpp and ZT_jniarray.cpp

* add Event.fromInt

* add PeerRole.fromInt

* add ResultCode.fromInt

* fix ANDROID-36: issues with ResultCode

* add VirtualNetworkConfigOperation.fromInt

* fix ANDROID-40: VirtualNetworkConfigOperation out-of-sync with ZT_VirtualNetworkConfigOperation enum

* add VirtualNetworkStatus.fromInt

* fix ANDROID-37: VirtualNetworkStatus out-of-sync with ZT_VirtualNetworkStatus enum

* add VirtualNetworkType.fromInt

* make NodeStatus a plain data class

* fix ANDROID-52: synchronization bug with nodeMap

* Node init work: separate Node construction and init

* add Node.toString

* make PeerPhysicalPath a plain data class

* remove unused PeerPhysicalPath.fixed

* add array functions

* make Peer a plain data class

* make Version a plain data class

* fix ANDROID-42: copy/paste error

* fix ANDROID-49: VirtualNetworkConfig.equals is wrong

* reimplement VirtualNetworkConfig.equals

* reimplement VirtualNetworkConfig.compareTo

* add VirtualNetworkConfig.hashCode

* make VirtualNetworkConfig a plain data class

* remove unused VirtualNetworkConfig.enabled

* reimplement VirtualNetworkDNS.equals

* add VirtualNetworkDNS.hashCode

* make VirtualNetworkDNS a plain data class

* reimplement VirtualNetworkRoute.equals

* reimplement VirtualNetworkRoute.compareTo

* reimplement VirtualNetworkRoute.toString

* add VirtualNetworkRoute.hashCode

* make VirtualNetworkRoute a plain data class

* add isSocketAddressEmpty

* add addressPort

* add fromSocketAddressObject

* invert logic in a couple of places and return early

* newInetAddress and newInetSocketAddress work
allow newInetSocketAddress to return NULL if given empty address

* fix ANDROID-38: stack corruption in onSendPacketRequested

* use GETENV macro

* JniRef work
JniRef does not use callbacks struct, so remove
fix NewGlobalRef / DeleteGlobalRef mismatch

* use PRId64 macros

* switch statement work

* comments and logging

* Modifier 'public' is redundant for interface members

* NodeException can be made a checked Exception

* 'NodeException' does not define a 'serialVersionUID' field

* 'finalize()' should not be overridden
this is fine to do because ZeroTierOneService calls close() when it is done

* error handling, error reporting, asserts, logging

* simplify loadLibrary

* rename Node.networks -> Node.networkConfigs

* Windows file permissions fix (#1887)

* Allow macOS interfaces to use multiple IP addresses (#1879)

Co-authored-by: Sean OMeara <someara@users.noreply.github.com>
Co-authored-by: Grant Limberg <glimberg@users.noreply.github.com>

* Fix condition where full HELLOs might not be sent when necessary (#1877)

Co-authored-by: Grant Limberg <glimberg@users.noreply.github.com>

* 1.10.4 version bumps

* Add security policy to repo (#1889)

* [+] add e2k64 arch (#1890)

* temp fix for ANDROID-56: crash inside newNetworkConfig from too many args

* 1.10.4 release notes

---------

Co-authored-by: travis laduke <travisladuke@gmail.com>
Co-authored-by: Grant Limberg <grant.limberg@zerotier.com>
Co-authored-by: Grant Limberg <glimberg@users.noreply.github.com>
Co-authored-by: Leonardo Amaral <leleobhz@users.noreply.github.com>
Co-authored-by: Brenton Bostick <bostick@gmail.com>
Co-authored-by: Sean OMeara <someara@users.noreply.github.com>
Co-authored-by: Joseph Henry <joseph-henry@users.noreply.github.com>
Co-authored-by: Roman Peshkichev <roman.peshkichev@gmail.com>
2023-03-07 16:50:34 -05:00
Joseph Henry
b88d7091c8
Simplify dump command. Fix bond list command 2023-01-20 13:54:04 -08:00
Joseph Henry
eccc31a4b9 Add forced TCP relay mode
This patch implements a "TUNNELED" status indicator and "forceTcpRelay" setting for custom relays via local.conf.

For example:

{
  "settings":
  {
    "tcpFallbackRelay": "6.79.53.215/443",
    "forceTcpRelay":true
  }
}
2023-01-12 07:12:19 +01:00
Joseph Henry
e1f60e3f83
Behavioral changes to multipath balance modes (See: #1745 and #1753) 2022-10-09 23:07:16 -07:00
Joseph Henry
bc521504ca
Improved multipath link monitoring 2022-09-20 14:27:34 -07:00
Joseph Henry
0797adf223
Improve output of bond list command 2022-09-16 13:43:34 -07:00
Adam Ierymenko
c6682f2a3f
Merge branch 'dev' of github.com:zerotier/ZeroTierOne into dev 2022-06-03 16:12:40 -04:00
Adam Ierymenko
4508a6687e
Version bump. 2022-06-03 15:42:06 -04:00
Grant Limberg
b65c1ed3a0
Add inja
Requries update to C++17 standard
2022-05-13 09:34:15 -07:00
Adam Ierymenko
ee0a194b25
Several more SSO/OIDC related fixes, and bump version to 1.8.9. 2022-04-19 21:29:11 -04:00
Joseph Henry
8148c658cf
Remove bonds for peers that have fully expired. Remove notion of bond health 2022-03-02 09:55:23 -08:00
staphen
1c956494a4
Use lowercase when including Windows headers 2021-12-29 16:29:08 -05:00
Grant Limberg
05df378dce
clear variables between gets for dump 2021-09-22 16:13:54 -07:00
Joseph Henry
e1af003e4f
Consolidation of multipath logic. Better system separation 2021-09-01 21:37:49 -07:00
Joseph Henry
2053415418
Fix erroneous listpeers last send and receive values 2021-08-04 12:16:26 -07:00
Grant Limberg
364ad87e2b
add ssoEnabled flag to network config 2021-06-05 13:44:45 -07:00
Adam Ierymenko
6b3a7ec827
Fix a few things... 2021-05-25 14:40:40 -04:00
Adam Ierymenko
2c1d7f3dcc
CLI printing of URL. 2021-05-25 12:58:33 -04:00
Joseph Henry
b64ae8c8a5
Fix for bug #1403 2021-05-18 00:05:46 -07:00
Joseph Henry
11ddbc6f30
Fix (some) compile-time warnings on Linux 2021-05-03 19:35:28 -07:00
Joseph Henry
1732f7371c
Minor bonding CLI fix 2021-04-07 15:15:35 -07:00
Joseph Henry
3870f7af27
Improve missing authtoken error message 2021-03-08 21:45:38 -08:00
YI
d526dca1bb fix sprintf overflow 2021-02-19 23:42:38 +08:00
Adam Ierymenko
bc4bd29488
Merge branch 'master' of github.com:zerotier/ZeroTierOne 2020-11-25 10:50:35 -05:00
Adam Ierymenko
d64c5a92c6
Merge pull request #1233 from dosuperuser/improvement/optimizations
Minor C++ optimizations
2020-11-24 19:24:36 -05:00
Adam Ierymenko
bad1e0d529 CentOS build fixes to build in Cent7. 2020-11-24 14:01:46 -08:00
Joseph Henry
ecfac0601a Add new bond control commands to CLI 2020-11-23 09:59:28 -08:00
Adam Ierymenko
167645ba6d
Fix for musl libc. 2020-11-20 21:10:08 -05:00
Adam Ierymenko
d2f2abe525
Add force-exit timeout to get around some of the exit hang issues users have observed. Will punt full diagnosis to V2 which rewrites all these code paths anyway. 2020-11-10 16:30:55 -05:00
Grant Limberg
ee04118172
null check 2020-10-13 08:24:36 -07:00
Adam Ierymenko
c86418934c PATH_MAX is not defined on some Linux systems. 2020-09-23 22:06:22 -04:00
Grant Limberg
afcbc6dd9f
clean up some error output 2020-09-16 10:54:14 -07:00