mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2026-09-22 15:29:03 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79b98a4b35 | ||
|
|
157c70ad07 | ||
|
|
a3b1a346c4 | ||
|
|
9c2d5cd74c | ||
|
|
fc5c3ec220 | ||
|
|
fe29cd8888 | ||
|
|
2ed9b86852 | ||
|
|
f87d5477f6 | ||
|
|
544809e738 | ||
|
|
d678338b28 | ||
|
|
7b747aff3b | ||
|
|
484d9e0d8c | ||
|
|
55aa87c372 | ||
|
|
aa586efbb5 | ||
|
|
a2340bf60c | ||
|
|
e918ec44d5 | ||
|
|
34777b6bb4 | ||
|
|
97db010112 | ||
|
|
e81053aed7 | ||
|
|
91428eacae | ||
|
|
936801a51b | ||
|
|
8f1b213994 | ||
|
|
7f47b2ba8f | ||
|
|
eac140aa73 | ||
|
|
d9a7f62a5c | ||
|
|
294af67370 | ||
|
|
67648579b5 |
No files matched your search
@@ -90,7 +90,7 @@ jobs:
|
||||
|
||||
|
||||
build_windows:
|
||||
runs-on: windows-latest
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: gitconfig
|
||||
run: |
|
||||
@@ -102,7 +102,7 @@ jobs:
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
target: aarch64-apple-darwin
|
||||
targets: x86_64-pc-windows-msvc
|
||||
components: rustfmt, clippy
|
||||
- name: Set up cargo cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
name: Central Controller CV1 Build and Push
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
central_controller:
|
||||
name: Central Controller CV1 Build
|
||||
strategy:
|
||||
matrix:
|
||||
runner: [gha-runner-x64, gha-runner-arm64]
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker Auth
|
||||
run: echo "${{ secrets.PORTUS_PW }}" | docker login registry.zerotier.com -u ${{ secrets.PORTUS_USER }} --password-stdin
|
||||
|
||||
- name: Get branch name and sanitize
|
||||
id: branch
|
||||
run: |
|
||||
BRANCH_NAME="${GITHUB_REF##*/}"
|
||||
SANITIZED_BRANCH="${BRANCH_NAME//\//-}"
|
||||
echo "branch_name=$SANITIZED_BRANCH" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get short git commit SHA
|
||||
id: sha
|
||||
run: |
|
||||
calculatedSha=$(git rev-parse --short ${{ github.sha }})
|
||||
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
|
||||
|
||||
- name: Build & Push Docker Image
|
||||
run: |
|
||||
docker build --provenance false --no-cache -t registry.zerotier.com/zerotier-central/ztcentral-controller:${{ env.COMMIT_SHORT_SHA }}-${{ steps.branch.outputs.branch_name }}-${{ runner.arch }} -f ext/central-controller-docker/Dockerfile . --push
|
||||
|
||||
multi-arch-docker:
|
||||
runs-on: gha-runner-x64
|
||||
needs: central_controller
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker Auth
|
||||
run: echo "${{ secrets.PORTUS_PW }}" | docker login registry.zerotier.com -u ${{ secrets.PORTUS_USER }} --password-stdin
|
||||
|
||||
- name: Get branch name and sanitize
|
||||
id: branch
|
||||
run: |
|
||||
BRANCH_NAME="${GITHUB_REF##*/}"
|
||||
SANITIZED_BRANCH="${BRANCH_NAME//\//-}"
|
||||
echo "branch_name=$SANITIZED_BRANCH" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get short git commit SHA
|
||||
id: sha
|
||||
run: |
|
||||
calculatedSha=$(git rev-parse --short ${{ github.sha }})
|
||||
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
|
||||
|
||||
- name: Create and push multi-arch manifest
|
||||
run: |
|
||||
docker manifest create registry.zerotier.com/zerotier-central/ztcentral-controller:${{ env.COMMIT_SHORT_SHA }}-${{ steps.branch.outputs.branch_name }} \
|
||||
--amend registry.zerotier.com/zerotier-central/ztcentral-controller:${{ env.COMMIT_SHORT_SHA }}-${{ steps.branch.outputs.branch_name }}-X64 \
|
||||
--amend registry.zerotier.com/zerotier-central/ztcentral-controller:${{ env.COMMIT_SHORT_SHA }}-${{ steps.branch.outputs.branch_name }}-ARM64
|
||||
docker manifest push registry.zerotier.com/zerotier-central/ztcentral-controller:${{ env.COMMIT_SHORT_SHA }}-${{ steps.branch.outputs.branch_name }}
|
||||
@@ -12,26 +12,25 @@ jobs:
|
||||
git config --global core.autocrlf input
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-unknown-linux-gnu
|
||||
override: true
|
||||
targets: x86_64-unknown-linux-gnu
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Set up cargo cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
continue-on-error: false
|
||||
with:
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('zeroidc//Cargo.lock') }}
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('rustybits//Cargo.lock') }}
|
||||
shared-key: ${{ runner.os }}-cargo-
|
||||
workspaces: |
|
||||
zeroidc/
|
||||
rustybits/
|
||||
|
||||
- name: validate-1m-linux
|
||||
env:
|
||||
|
||||
@@ -91,6 +91,7 @@ debian/zerotier-one*.debhelper
|
||||
debian/*.log
|
||||
debian/zerotier-one.substvars
|
||||
root-watcher/config.json
|
||||
build/
|
||||
|
||||
# Java/Android/JNI build droppings
|
||||
java/obj/
|
||||
@@ -106,6 +107,7 @@ windows/WinUI/bin/
|
||||
windows/ZeroTierOne/Debug/
|
||||
/ext/installfiles/windows/chocolatey/zerotier-one/*.nupkg
|
||||
|
||||
|
||||
# Miscellaneous mac/Xcode droppings
|
||||
.Trashes
|
||||
*.swp
|
||||
@@ -141,3 +143,6 @@ __pycache__
|
||||
*.pyc
|
||||
*_source.tar.bz2
|
||||
snap/.snapcraft
|
||||
|
||||
# local Claude configurations
|
||||
.claude/*.local.*
|
||||
+9
-1
@@ -1,8 +1,16 @@
|
||||
ZeroTier Release Notes
|
||||
======
|
||||
|
||||
## 2025-12-22 -- Version 1.16.1
|
||||
## 2026-05-20 -- Version 1.16.2
|
||||
|
||||
* Fixed line endings for the zttap300.inf for the Windows ARM x64 install.
|
||||
* Internal updates to the central controller (CV1) including schema changes and a multi-architecture Docker build pipeline.
|
||||
* Increased `ZT_MAX_NETWORK_SPECIALISTS` from 256 to 512 to accommodate users with large networks that exceeded the previous limit. The network config dictionary capacity was raised correspondingly.
|
||||
* Resolved intermittent multi-minute delays when leaving one network and joining another under Windows.
|
||||
* Compiler warning cleanup across the codebase, covering GCC 14, Clang 18, and Clang 21.
|
||||
|
||||
## 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.
|
||||
|
||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
zerotier-one (1.16.1) unstable; urgency=medium
|
||||
zerotier-one (1.16.2) unstable; urgency=medium
|
||||
|
||||
* See RELEASE-NOTES.md for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Mon, 12 Dec 2025 01:00:00 -0700
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Wed, 27 May 2026 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.16.0-2) unstable; urgency=medium
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ FROM registry.zerotier.com/zerotier/ctlbuild:2025-07-14 AS builder
|
||||
ADD . /ZeroTierOne
|
||||
RUN export PATH=$PATH:~/.cargo/bin && cd ZeroTierOne && make clean && make central-controller -j8
|
||||
|
||||
FROM golang:bookworm AS go_base
|
||||
RUN go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
|
||||
FROM golang:1.24.1-bookworm AS go_base
|
||||
RUN GONOSUMDB=* GOFLAGS='-p=1' go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
|
||||
|
||||
FROM registry.zerotier.com/zerotier/ctlrun:2025-07-14 AS run_base
|
||||
COPY --from=builder /ZeroTierOne/zerotier-one /usr/local/bin/zerotier-one
|
||||
|
||||
@@ -702,7 +702,7 @@
|
||||
<key>USE_HFS+_COMPRESSION</key>
|
||||
<false />
|
||||
<key>VERSION</key>
|
||||
<string>1.16.1</string>
|
||||
<string>1.16.2</string>
|
||||
</dict>
|
||||
<key>TYPE</key>
|
||||
<integer>0</integer>
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -135,7 +135,7 @@ extern "C" {
|
||||
/**
|
||||
* Maximum number of "specialists" on a network -- bridges, relays, etc.
|
||||
*/
|
||||
#define ZT_MAX_NETWORK_SPECIALISTS 256
|
||||
#define ZT_MAX_NETWORK_SPECIALISTS 512
|
||||
|
||||
/**
|
||||
* Maximum number of multicast group subscriptions per network
|
||||
|
||||
@@ -472,10 +472,6 @@ central-controller-docker: _buildx FORCE
|
||||
docker buildx build --platform linux/amd64,linux/arm64 --no-cache -t registry.zerotier.com/zerotier-central/ztcentral-controller:${TIMESTAMP} -f ext/central-controller-docker/Dockerfile --build-arg git_branch=`git name-rev --name-only HEAD` . --push
|
||||
@echo Image: registry.zerotier.com/zerotier-central/ztcentral-controller:${TIMESTAMP}
|
||||
|
||||
centralv2-controller-docker: _buildx FORCE
|
||||
docker buildx build --platform linux/amd64,linux/arm64 --no-cache -t us-central1-docker.pkg.dev/zerotier-421eb9/docker-images/ztcentral-controller:$(shell git rev-parse --short HEAD) -f ext/central-controller-docker/Dockerfile --build-arg git_branch=`git name-rev --name-only HEAD` . --push
|
||||
@echo Image: us-central1-docker.pkg.dev/zerotier-421eb9/docker-images/ztcentral-controller:$(shell git rev-parse --short HEAD)
|
||||
|
||||
debug: FORCE
|
||||
make ZT_DEBUG=1 one
|
||||
make ZT_DEBUG=1 selftest
|
||||
|
||||
+1
-2
@@ -58,7 +58,6 @@ class Capability : public Credential {
|
||||
Capability() : _nwid(0), _ts(0), _id(0), _maxCustodyChainLength(0), _ruleCount(0)
|
||||
{
|
||||
memset(_rules, 0, sizeof(_rules));
|
||||
memset(_custody, 0, sizeof(_custody));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -513,7 +512,7 @@ class Capability : public Credential {
|
||||
Address to;
|
||||
Address from;
|
||||
ECC::Signature signature;
|
||||
} _custody[ZT_MAX_CAPABILITY_CUSTODY_CHAIN_LENGTH];
|
||||
} _custody[ZT_MAX_CAPABILITY_CUSTODY_CHAIN_LENGTH] = {};
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
||||
+3
-3
@@ -35,7 +35,7 @@ namespace ZeroTier {
|
||||
*/
|
||||
class Identity {
|
||||
public:
|
||||
Identity() : _privateKey((ECC::Private*)0)
|
||||
Identity() : _publicKey{0}, _privateKey{(ECC::Private*)0}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -43,14 +43,14 @@ class Identity {
|
||||
{
|
||||
}
|
||||
|
||||
Identity(const char* str) : _privateKey((ECC::Private*)0)
|
||||
Identity(const char* str) : _publicKey{0}, _privateKey{(ECC::Private*)0}
|
||||
{
|
||||
if (! fromString(str)) {
|
||||
throw ZT_EXCEPTION_INVALID_SERIALIZED_DATA_INVALID_TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
template <unsigned int C> Identity(const Buffer<C>& b, unsigned int startAt = 0) : _privateKey((ECC::Private*)0)
|
||||
template <unsigned int C> Identity(const Buffer<C>& b, unsigned int startAt = 0) : _publicKey{0}, _privateKey{(ECC::Private*)0}
|
||||
{
|
||||
deserialize(b, startAt);
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ InetAddress::IpScope InetAddress::ipScope() const
|
||||
|
||||
void InetAddress::set(const void* ipBytes, unsigned int ipLen, unsigned int port)
|
||||
{
|
||||
memset(this, 0, sizeof(InetAddress));
|
||||
memset(static_cast<void*>(this), 0, sizeof(InetAddress));
|
||||
if (ipLen == 4) {
|
||||
uint32_t ipb[1];
|
||||
memcpy(ipb, ipBytes, 4);
|
||||
@@ -215,7 +215,7 @@ bool InetAddress::fromString(const char* ipSlashPort)
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
memset(this, 0, sizeof(InetAddress));
|
||||
memset(static_cast<void*>(this), 0, sizeof(InetAddress));
|
||||
|
||||
if (! *ipSlashPort) {
|
||||
return true;
|
||||
|
||||
+23
-23
@@ -74,15 +74,15 @@ struct InetAddress : public sockaddr_storage {
|
||||
|
||||
InetAddress()
|
||||
{
|
||||
memset(this, 0, sizeof(InetAddress));
|
||||
memset(static_cast<void*>(this), 0, sizeof(InetAddress));
|
||||
}
|
||||
InetAddress(const InetAddress& a)
|
||||
{
|
||||
memcpy(this, &a, sizeof(InetAddress));
|
||||
memcpy(static_cast<void*>(this), &a, sizeof(InetAddress));
|
||||
}
|
||||
InetAddress(const InetAddress* a)
|
||||
{
|
||||
memcpy(this, a, sizeof(InetAddress));
|
||||
memcpy(static_cast<void*>(this), a, sizeof(InetAddress));
|
||||
}
|
||||
InetAddress(const struct sockaddr_storage& ss)
|
||||
{
|
||||
@@ -132,7 +132,7 @@ struct InetAddress : public sockaddr_storage {
|
||||
inline InetAddress& operator=(const InetAddress& a)
|
||||
{
|
||||
if (&a != this) {
|
||||
memcpy(this, &a, sizeof(InetAddress));
|
||||
memcpy(static_cast<void*>(this), &a, sizeof(InetAddress));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -140,7 +140,7 @@ struct InetAddress : public sockaddr_storage {
|
||||
inline InetAddress& operator=(const InetAddress* a)
|
||||
{
|
||||
if (a != this) {
|
||||
memcpy(this, a, sizeof(InetAddress));
|
||||
memcpy(static_cast<void*>(this), a, sizeof(InetAddress));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ struct InetAddress : public sockaddr_storage {
|
||||
inline InetAddress& operator=(const struct sockaddr_storage& ss)
|
||||
{
|
||||
if (reinterpret_cast<const InetAddress*>(&ss) != this) {
|
||||
memcpy(this, &ss, sizeof(InetAddress));
|
||||
memcpy(static_cast<void*>(this), &ss, sizeof(InetAddress));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ struct InetAddress : public sockaddr_storage {
|
||||
inline InetAddress& operator=(const struct sockaddr_storage* ss)
|
||||
{
|
||||
if (reinterpret_cast<const InetAddress*>(ss) != this) {
|
||||
memcpy(this, ss, sizeof(InetAddress));
|
||||
memcpy(static_cast<void*>(this), ss, sizeof(InetAddress));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -164,8 +164,8 @@ struct InetAddress : public sockaddr_storage {
|
||||
inline InetAddress& operator=(const struct sockaddr_in& sa)
|
||||
{
|
||||
if (reinterpret_cast<const InetAddress*>(&sa) != this) {
|
||||
memset(this, 0, sizeof(InetAddress));
|
||||
memcpy(this, &sa, sizeof(struct sockaddr_in));
|
||||
memset(static_cast<void*>(this), 0, sizeof(InetAddress));
|
||||
memcpy(static_cast<void*>(this), &sa, sizeof(struct sockaddr_in));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -173,8 +173,8 @@ struct InetAddress : public sockaddr_storage {
|
||||
inline InetAddress& operator=(const struct sockaddr_in* sa)
|
||||
{
|
||||
if (reinterpret_cast<const InetAddress*>(sa) != this) {
|
||||
memset(this, 0, sizeof(InetAddress));
|
||||
memcpy(this, sa, sizeof(struct sockaddr_in));
|
||||
memset(static_cast<void*>(this), 0, sizeof(InetAddress));
|
||||
memcpy(static_cast<void*>(this), sa, sizeof(struct sockaddr_in));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -182,8 +182,8 @@ struct InetAddress : public sockaddr_storage {
|
||||
inline InetAddress& operator=(const struct sockaddr_in6& sa)
|
||||
{
|
||||
if (reinterpret_cast<const InetAddress*>(&sa) != this) {
|
||||
memset(this, 0, sizeof(InetAddress));
|
||||
memcpy(this, &sa, sizeof(struct sockaddr_in6));
|
||||
memset(static_cast<void*>(this), 0, sizeof(InetAddress));
|
||||
memcpy(static_cast<void*>(this), &sa, sizeof(struct sockaddr_in6));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -191,8 +191,8 @@ struct InetAddress : public sockaddr_storage {
|
||||
inline InetAddress& operator=(const struct sockaddr_in6* sa)
|
||||
{
|
||||
if (reinterpret_cast<const InetAddress*>(sa) != this) {
|
||||
memset(this, 0, sizeof(InetAddress));
|
||||
memcpy(this, sa, sizeof(struct sockaddr_in6));
|
||||
memset(static_cast<void*>(this), 0, sizeof(InetAddress));
|
||||
memcpy(static_cast<void*>(this), sa, sizeof(struct sockaddr_in6));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -200,13 +200,13 @@ struct InetAddress : public sockaddr_storage {
|
||||
inline InetAddress& operator=(const struct sockaddr& sa)
|
||||
{
|
||||
if (reinterpret_cast<const InetAddress*>(&sa) != this) {
|
||||
memset(this, 0, sizeof(InetAddress));
|
||||
memset(static_cast<void*>(this), 0, sizeof(InetAddress));
|
||||
switch (sa.sa_family) {
|
||||
case AF_INET:
|
||||
memcpy(this, &sa, sizeof(struct sockaddr_in));
|
||||
memcpy(static_cast<void*>(this), &sa, sizeof(struct sockaddr_in));
|
||||
break;
|
||||
case AF_INET6:
|
||||
memcpy(this, &sa, sizeof(struct sockaddr_in6));
|
||||
memcpy(static_cast<void*>(this), &sa, sizeof(struct sockaddr_in6));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -216,13 +216,13 @@ struct InetAddress : public sockaddr_storage {
|
||||
inline InetAddress& operator=(const struct sockaddr* sa)
|
||||
{
|
||||
if (reinterpret_cast<const InetAddress*>(sa) != this) {
|
||||
memset(this, 0, sizeof(InetAddress));
|
||||
memset(static_cast<void*>(this), 0, sizeof(InetAddress));
|
||||
switch (sa->sa_family) {
|
||||
case AF_INET:
|
||||
memcpy(this, sa, sizeof(struct sockaddr_in));
|
||||
memcpy(static_cast<void*>(this), sa, sizeof(struct sockaddr_in));
|
||||
break;
|
||||
case AF_INET6:
|
||||
memcpy(this, sa, sizeof(struct sockaddr_in6));
|
||||
memcpy(static_cast<void*>(this), sa, sizeof(struct sockaddr_in6));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -513,7 +513,7 @@ struct InetAddress : public sockaddr_storage {
|
||||
*/
|
||||
inline void zero()
|
||||
{
|
||||
memset(this, 0, sizeof(InetAddress));
|
||||
memset(static_cast<void*>(this), 0, sizeof(InetAddress));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -635,7 +635,7 @@ struct InetAddress : public sockaddr_storage {
|
||||
|
||||
template <unsigned int C> inline unsigned int deserialize(const Buffer<C>& b, unsigned int startAt = 0)
|
||||
{
|
||||
memset(this, 0, sizeof(InetAddress));
|
||||
memset(static_cast<void*>(this), 0, sizeof(InetAddress));
|
||||
unsigned int p = startAt;
|
||||
switch (b[p++]) {
|
||||
case 0:
|
||||
|
||||
+5
-9
@@ -479,15 +479,11 @@ class Network {
|
||||
int64_t _lastConfigUpdate;
|
||||
|
||||
struct _IncomingConfigChunk {
|
||||
_IncomingConfigChunk()
|
||||
{
|
||||
memset(this, 0, sizeof(_IncomingConfigChunk));
|
||||
}
|
||||
uint64_t ts;
|
||||
uint64_t updateId;
|
||||
uint64_t haveChunkIds[ZT_NETWORK_MAX_UPDATE_CHUNKS];
|
||||
unsigned long haveChunks;
|
||||
unsigned long haveBytes;
|
||||
uint64_t ts = 0;
|
||||
uint64_t updateId = 0;
|
||||
uint64_t haveChunkIds[ZT_NETWORK_MAX_UPDATE_CHUNKS]{};
|
||||
unsigned long haveChunks = 0;
|
||||
unsigned long haveBytes = 0;
|
||||
Dictionary<ZT_NETWORKCONFIG_DICT_CAPACITY> data;
|
||||
};
|
||||
_IncomingConfigChunk _incomingConfigChunks[ZT_NETWORK_MAX_INCOMING_UPDATES];
|
||||
|
||||
@@ -50,7 +50,6 @@ NetworkConfig::NetworkConfig()
|
||||
name[0] = 0;
|
||||
memset(specialists, 0, sizeof(uint64_t) * ZT_MAX_NETWORK_SPECIALISTS);
|
||||
memset(routes, 0, sizeof(ZT_VirtualNetworkRoute) * ZT_MAX_NETWORK_ROUTES);
|
||||
memset(staticIps, 0, sizeof(InetAddress) * ZT_MAX_ZT_ASSIGNED_ADDRESSES);
|
||||
memset(rules, 0, sizeof(ZT_VirtualNetworkRule) * ZT_MAX_NETWORK_RULES);
|
||||
memset(&dns, 0, sizeof(ZT_VirtualNetworkDNS));
|
||||
memset(authenticationURL, 0, sizeof(authenticationURL));
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace ZeroTier {
|
||||
|
||||
// Dictionary capacity needed for max size network config
|
||||
#define ZT_NETWORKCONFIG_DICT_CAPACITY \
|
||||
(4096 + (sizeof(ZT_VirtualNetworkConfig)) + (sizeof(ZT_VirtualNetworkRule) * ZT_MAX_NETWORK_RULES) + (sizeof(Capability) * ZT_MAX_NETWORK_CAPABILITIES) + (sizeof(Tag) * ZT_MAX_NETWORK_TAGS) \
|
||||
((4096 + 2048) + (sizeof(ZT_VirtualNetworkConfig)) + (sizeof(ZT_VirtualNetworkRule) * ZT_MAX_NETWORK_RULES) + (sizeof(Capability) * ZT_MAX_NETWORK_CAPABILITIES) + (sizeof(Tag) * ZT_MAX_NETWORK_TAGS) \
|
||||
+ (sizeof(CertificateOfOwnership) * ZT_MAX_CERTIFICATES_OF_OWNERSHIP))
|
||||
|
||||
// Dictionary capacity needed for max size network meta-data
|
||||
@@ -562,7 +562,7 @@ class NetworkConfig {
|
||||
/**
|
||||
* Static IP assignments
|
||||
*/
|
||||
InetAddress staticIps[ZT_MAX_ZT_ASSIGNED_ADDRESSES];
|
||||
InetAddress staticIps[ZT_MAX_ZT_ASSIGNED_ADDRESSES] = {};
|
||||
|
||||
/**
|
||||
* Base network rules
|
||||
|
||||
+11
-4
@@ -472,6 +472,10 @@ ZT_ResultCode Node::leave(uint64_t nwid, void** uptr, void* tptr)
|
||||
{
|
||||
ZT_VirtualNetworkConfig ctmp;
|
||||
void** nUserPtr = (void**)0;
|
||||
// Keep a local SharedPtr to the network so we can call the destroy
|
||||
// callback after releasing the lock, without leaving a window during
|
||||
// which _networks still contains a destroyed-but-not-erased entry.
|
||||
SharedPtr<Network> nwHold;
|
||||
{
|
||||
Mutex::Lock _l(_networks_m);
|
||||
SharedPtr<Network>* nw = _networks.get(nwid);
|
||||
@@ -485,16 +489,19 @@ ZT_ResultCode Node::leave(uint64_t nwid, void** uptr, void* tptr)
|
||||
(*nw)->externalConfig(&ctmp);
|
||||
(*nw)->destroy();
|
||||
nUserPtr = (*nw)->userPtr();
|
||||
|
||||
// Move the SharedPtr out and erase the map entry atomically with
|
||||
// destroy(), under the same lock. From here on _networks does not
|
||||
// contain this nwid; a concurrent join() will construct fresh.
|
||||
nwHold = *nw;
|
||||
_networks.erase(nwid);
|
||||
}
|
||||
|
||||
if (nUserPtr) {
|
||||
RR->node->configureVirtualNetworkPort(tptr, nwid, nUserPtr, ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY, &ctmp);
|
||||
}
|
||||
|
||||
{
|
||||
Mutex::Lock _l(_networks_m);
|
||||
_networks.erase(nwid);
|
||||
}
|
||||
// nwHold goes out of scope here, finally releasing the Network.
|
||||
|
||||
uint64_t tmp[2];
|
||||
tmp[0] = nwid;
|
||||
|
||||
@@ -67,7 +67,6 @@ void PacketMultiplexer::setUpPostDecodeReceiveThreads(unsigned int concurrency,
|
||||
#endif
|
||||
_enabled = true;
|
||||
_concurrency = concurrency;
|
||||
bool _enablePinning = cpuPinningEnabled;
|
||||
|
||||
for (unsigned int i = 0; i < _concurrency; ++i) {
|
||||
fprintf(stderr, "Reserved queue for thread %d\n", i);
|
||||
@@ -76,7 +75,7 @@ void PacketMultiplexer::setUpPostDecodeReceiveThreads(unsigned int concurrency,
|
||||
|
||||
// Each thread picks from its own queue to feed into the core
|
||||
for (unsigned int i = 0; i < _concurrency; ++i) {
|
||||
_rxThreads.push_back(std::thread([this, i, _enablePinning]() {
|
||||
_rxThreads.push_back(std::thread([this, i]() {
|
||||
fprintf(stderr, "Created post-decode packet ingestion thread %d\n", i);
|
||||
|
||||
PacketRecord* packet = nullptr;
|
||||
|
||||
Loaded 20 of 34 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user