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