1.10.6 merge to main (#1930)

* 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

* Windows 1.10.4 Advanced Installer bump

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

This reverts commit dd627cd7f4.

* actual fix for ANDROID-56: crash inside newNetworkConfig
cast all arguments to varargs functions as good style

* Fix addIp being called with applied ips (#1897)

This was getting called outside of the check for existing ips
Because of the added ifdef and a brace getting moved to the
wrong place.

```
if (! n.tap()->addIp(*ip)) {
	fprintf(stderr, "ERROR: unable to add ip address %s" ZT_EOL_S, ip->toString(ipbuf));
}
WinFWHelper::newICMPRule(*ip, n.config().nwid);

```

* 1.10.5 (#1905)

* 1.10.5 bump

* 1.10.5 for Windows

* 1.10.5

* Prevent path-learning loops (#1914)

* Prevent path-learning loops

* Only allow new overwrite if not bonded

* fix binding temporary ipv6 addresses on macos (#1910)

The check code wasn't running.

I don't know why !defined(TARGET_OS_IOS) would exclude code on
desktop macOS. I did a quick search and changed it to defined(TARGET_OS_MAC).
Not 100% sure what the most correct solution there is.

You can verify the old and new versions with

`ifconfig | grep temporary`

plus

`zerotier-cli info -j` -> listeningOn

* 1.10.6 (#1929)

* 1.10.5 bump

* 1.10.6

* 1.10.6 AIP for Windows.

---------

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>
This commit is contained in:
Adam Ierymenko 2023-03-23 13:38:53 -04:00 committed by GitHub
parent 1c5897895b
commit a872cc3418
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 184 additions and 181 deletions

View file

@ -162,7 +162,7 @@ namespace {
jint ret = env->CallIntMethod(
ref->configListener,
VirtualNetworkConfigListener_onNetworkConfigurationUpdated_method,
(jlong)nwid, operationObject, networkConfigObject);
(jlong)nwid, (jobject)operationObject, (jobject)networkConfigObject);
if (env->ExceptionCheck()) {
LOGE("Exception calling onNetworkConfigurationUpdated");
return -105;
@ -213,7 +213,7 @@ namespace {
return;
}
env->CallVoidMethod(ref->frameListener, VirtualNetworkFrameListener_onVirtualNetworkFrame_method, (jlong)nwid, (jlong)sourceMac, (jlong)destMac, (jlong)etherType, (jlong)vlanid, dataArray);
env->CallVoidMethod(ref->frameListener, VirtualNetworkFrameListener_onVirtualNetworkFrame_method, (jlong)nwid, (jlong)sourceMac, (jlong)destMac, (jlong)etherType, (jlong)vlanid, (jbyteArray)dataArray);
if (env->ExceptionCheck()) {
LOGE("Exception calling onVirtualNetworkFrame");
return;
@ -254,7 +254,7 @@ namespace {
switch (event) {
case ZT_EVENT_UP: {
LOGD("Event Up");
env->CallVoidMethod(ref->eventListener, EventListener_onEvent_method, eventObject);
env->CallVoidMethod(ref->eventListener, EventListener_onEvent_method, (jobject)eventObject);
if (env->ExceptionCheck()) {
LOGE("Exception calling onEvent");
return;
@ -263,7 +263,7 @@ namespace {
}
case ZT_EVENT_OFFLINE: {
LOGD("Event Offline");
env->CallVoidMethod(ref->eventListener, EventListener_onEvent_method, eventObject);
env->CallVoidMethod(ref->eventListener, EventListener_onEvent_method, (jobject)eventObject);
if (env->ExceptionCheck()) {
LOGE("Exception calling onEvent");
return;
@ -272,7 +272,7 @@ namespace {
}
case ZT_EVENT_ONLINE: {
LOGD("Event Online");
env->CallVoidMethod(ref->eventListener, EventListener_onEvent_method, eventObject);
env->CallVoidMethod(ref->eventListener, EventListener_onEvent_method, (jobject)eventObject);
if (env->ExceptionCheck()) {
LOGE("Exception calling onEvent");
return;
@ -281,7 +281,7 @@ namespace {
}
case ZT_EVENT_DOWN: {
LOGD("Event Down");
env->CallVoidMethod(ref->eventListener, EventListener_onEvent_method, eventObject);
env->CallVoidMethod(ref->eventListener, EventListener_onEvent_method, (jobject)eventObject);
if (env->ExceptionCheck()) {
LOGE("Exception calling onEvent");
return;
@ -291,7 +291,7 @@ namespace {
case ZT_EVENT_FATAL_ERROR_IDENTITY_COLLISION: {
LOGV("Identity Collision");
// call onEvent()
env->CallVoidMethod(ref->eventListener, EventListener_onEvent_method, eventObject);
env->CallVoidMethod(ref->eventListener, EventListener_onEvent_method, (jobject)eventObject);
if (env->ExceptionCheck()) {
LOGE("Exception calling onEvent");
return;
@ -311,7 +311,7 @@ namespace {
return;
}
env->CallVoidMethod(ref->eventListener, EventListener_onTrace_method, messageStr);
env->CallVoidMethod(ref->eventListener, EventListener_onTrace_method, (jstring)messageStr);
if (env->ExceptionCheck()) {
LOGE("Exception calling onTrace");
return;
@ -398,7 +398,7 @@ namespace {
int retval = env->CallIntMethod(ref->dataStorePutListener,
DataStorePutListener_onDataStorePut_method,
nameStr, bufferObj, secure);
(jstring)nameStr, (jbyteArray)bufferObj, (jboolean)secure);
if (env->ExceptionCheck()) {
LOGE("Exception calling onDataStorePut");
return;
@ -410,7 +410,7 @@ namespace {
} else {
LOGD("JNI: Delete file: %s", p);
int retval = env->CallIntMethod(ref->dataStorePutListener, DataStorePutListener_onDelete_method, nameStr);
int retval = env->CallIntMethod(ref->dataStorePutListener, DataStorePutListener_onDelete_method, (jstring)nameStr);
if (env->ExceptionCheck()) {
LOGE("Exception calling onDelete");
return;
@ -500,8 +500,8 @@ namespace {
int retval = (int)env->CallLongMethod(
ref->dataStoreGetListener,
DataStoreGetListener_onDataStoreGet_method,
nameStr,
bufferObj);
(jstring)nameStr,
(jbyteArray)bufferObj);
if (env->ExceptionCheck()) {
LOGE("Exception calling onDataStoreGet");
return -106;
@ -570,7 +570,7 @@ namespace {
return -103;
}
int retval = env->CallIntMethod(ref->packetSender, PacketSender_onSendPacketRequested_method, localSocket, remoteAddressObj, bufferObj, 0);
int retval = env->CallIntMethod(ref->packetSender, PacketSender_onSendPacketRequested_method, (jlong)localSocket, (jobject)remoteAddressObj, (jbyteArray)bufferObj, (jint)0);
if (env->ExceptionCheck()) {
LOGE("Exception calling onSendPacketRequested");
return -104;
@ -616,7 +616,7 @@ namespace {
return true;
}
jboolean ret = env->CallBooleanMethod(ref->pathChecker, PathChecker_onPathCheck_method, address, localSocket, remoteAddressObj);
jboolean ret = env->CallBooleanMethod(ref->pathChecker, PathChecker_onPathCheck_method, (jlong)address, (jlong)localSocket, (jobject)remoteAddressObj);
if (env->ExceptionCheck()) {
LOGE("Exception calling onPathCheck");
return true;
@ -656,7 +656,7 @@ namespace {
//
// may be NULL
//
jobject sockAddressObject = env->CallObjectMethod(ref->pathChecker, PathChecker_onPathLookup_method, address, ss_family);
jobject sockAddressObject = env->CallObjectMethod(ref->pathChecker, PathChecker_onPathLookup_method, (jlong)address, (jint)ss_family);
if (env->ExceptionCheck()) {
LOGE("Unable to call onPathLookup implementation");
return false;