diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..92a2674
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,46 @@
+---
+name: Bug report
+about: Create a report to help us improve
+
+---
+**Alternative, faster ways to get help**
+If you have just started using ZeroTier, here are some places to get help:
+- my.zerotier.com has a _Community_ tab. It's a live chat with other users and the developers.
+- [ZeroTier Knowledge Base](https://zerotier.atlassian.net/wiki/spaces/SD/overview)
+- www.zerotier.com has a Contact Us button
+- email contact@zerotier.com
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Create a Network '...'
+2. Install zerotier-one '....'
+3. '....'
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots or console output to help explain your problem.
+
+**Desktop (please complete the following information):**
+ - OS: [e.g. Mac, Linux, Windows, BSD]
+ - OS/Distribution Version
+ - ZeroTier Version [e.g. 1.2.4]
+ - Hardware [e.g. raspberry pi 3]
+
+**Smartphone (please complete the following information):**
+ - Device: [e.g. iPhone6]
+ - OS: [e.g. iOS8.1]
+ - Version [e.g. 1.2.4]
+
+**Additional context**
+Add any other context about the problem here.
+- ZeroTier Network Configuration
+- Router Config
+- Firewall Config (try turning the firewall off)
+- General Network Environment: [ e.g Home, University Campus, Corporate LAN ]
+
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..066b2d9
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,17 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.gitignore b/.gitignore
index bd884dc..44b5eb5 100755
--- a/.gitignore
+++ b/.gitignore
@@ -1,16 +1,17 @@
-<<<<<<< HEAD
# Main binaries created in *nix builds
/zerotier-one
/zerotier-idtool
/zerotier-cli
/zerotier-selftest
/zerotier
+/nltest
# OS-created garbage files from various platforms
.DS_Store
.Apple*
Thumbs.db
@eaDir
+._*
# Windows build droppings
/windows/ZeroTierOne.sdf
@@ -27,6 +28,7 @@ Thumbs.db
/windows/Release
/windows/WebUIWrapper/bin
/windows/WebUIWrapper/obj
+/windows/lib
/ext/installfiles/windows/ZeroTier One-SetupFiles
/ext/installfiles/windows/Prerequisites
/ext/installfiles/windows/*-cache
@@ -49,6 +51,7 @@ enc_temp_folder
/world/mkworld
/world/*.c25519
zt1-src.tar.gz
+/MacEthernetTapAgent
# Miscellaneous temporaries, build files, etc.
*.log
@@ -111,3 +114,9 @@ build/
!default.perspectivev3
*.xccheckout
xcuserdata/
+ext/librethinkdbxx/build
+.vscode
+__pycache__
+*~
+attic/world/*.c25519
+attic/world/mkworld
diff --git a/AUTHORS.md b/AUTHORS.md
index 043ff00..c4c0c73 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -2,6 +2,7 @@
* ZeroTier Core and ZeroTier One virtual networking service
Adam Ierymenko / adam.ierymenko@zerotier.com
+ Joseph Henry / joseph.henry@zerotier.com (QoS and multipath)
* Java JNI Interface to enable Android application development, and Android app itself (code for that is elsewhere)
Grant Limberg / glimberg@gmail.com
@@ -45,13 +46,6 @@ ZeroTier includes the following third party code, either in ext/ or incorporated
* Home page: https://github.com/nlohmann/json
* License grant: MIT
- * TunTapOSX by Mattias Nissler
-
- * Files: ext/tap-mac/tuntap/*
- * Home page: http://tuntaposx.sourceforge.net/
- * License grant: BSD attribution no-endorsement
- * ZeroTier Modifications: change interface name to zt#, increase max MTU, increase max devices
-
* tap-windows6 by the OpenVPN project
* Files: windows/TapDriver6/*
@@ -71,3 +65,9 @@ ZeroTier includes the following third party code, either in ext/ or incorporated
* Files: ext/libnatpmp/* ext/miniupnpc/*
* Home page: http://miniupnp.free.fr/
* License grant: BSD attribution no-endorsement
+
+ * cpp-httplib by yhirose
+
+ * Files: ext/cpp-httplib/*
+ * Home page: https://github.com/yhirose/cpp-httplib
+ * License grant: MIT
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..fff7808
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,12 @@
+# CMake build script for libzerotiercore.a
+
+cmake_minimum_required (VERSION 2.8)
+project (zerotiercore)
+
+set (PROJ_DIR ${PROJECT_SOURCE_DIR})
+set (ZT_DEFS -std=c++11)
+
+file(GLOB core_src_glob ${PROJ_DIR}/node/*.cpp)
+add_library(zerotiercore STATIC ${core_src_glob})
+
+target_compile_options(zerotiercore PRIVATE ${ZT_DEFS})
diff --git a/COPYING b/COPYING
index 23d42df..c43e8e7 100644
--- a/COPYING
+++ b/COPYING
@@ -1,5 +1,5 @@
ZeroTier One, an endpoint server for the ZeroTier virtual network layer.
-Copyright © 2011–2016 ZeroTier, Inc.
+Copyright © 2011–2019 ZeroTier, Inc.
ZeroTier One is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/Jenkinsfile b/Jenkinsfile
index 74c8624..8898932 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,9 +1,11 @@
#!/usr/bin/env groovy
node('master') {
+ checkout scm
+
def changelog = getChangeLog currentBuild
- slackSend "Building ${env.JOB_NAME} #${env.BUILD_NUMBER} \n Change Log: \n ${changelog}"
+ mattermostSend "Building ${env.JOB_NAME} #${env.BUILD_NUMBER} \n Change Log: \n ${changelog}"
}
parallel 'centos7': {
@@ -17,66 +19,66 @@ parallel 'centos7': {
}
catch (err) {
currentBuild.result = "FAILURE"
- slackSend color: '#ff0000', message: "${env.JOB_NAME} broken on Centos 7 (<${env.BUILD_URL}|Open>)"
+ mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Centos 7 (<${env.BUILD_URL}|Open>)"
throw err
}
}
-}, 'android-ndk': {
- node('android-ndk') {
- try {
- checkout scm
+// }, 'android-ndk': {
+// node('android-ndk') {
+// try {
+// checkout scm
- stage('Build Android NDK') {
- sh "/android/android-ndk-r13b/ndk-build -C $WORKSPACE/java ZT1=${WORKSPACE}"
- }
- }
- catch (err) {
- currentBuild.result = "FAILURE"
- slackSend color: '#ff0000', message: "${env.JOB_NAME} broken on Android NDK (<${env.BUILD_URL}|Open>)"
+// stage('Build Android NDK') {
+// sh "/android/android-ndk-r15b/ndk-build -C $WORKSPACE/java ZT1=${WORKSPACE}"
+// }
+// }
+// catch (err) {
+// currentBuild.result = "FAILURE"
+// mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Android NDK (<${env.BUILD_URL}|Open>)"
- throw err
- }
- }
-}, 'macOS': {
- node('macOS') {
- try {
- checkout scm
+// throw err
+// }
+// }
+// }, 'macOS': {
+// node('macOS') {
+// try {
+// checkout scm
- stage('Build macOS') {
- sh 'make -f make-mac.mk'
- }
+// stage('Build macOS') {
+// sh 'make -f make-mac.mk'
+// }
- stage('Build macOS UI') {
- sh 'cd macui && xcodebuild -target "ZeroTier One" -configuration Debug'
- }
- }
- catch (err) {
- currentBuild.result = "FAILURE"
- slackSend color: '#ff0000', message: "${env.JOB_NAME} broken on macOS (<${env.BUILD_URL}|Open>)"
+// stage('Build macOS UI') {
+// sh 'cd macui && xcodebuild -target "ZeroTier One" -configuration Debug'
+// }
+// }
+// catch (err) {
+// currentBuild.result = "FAILURE"
+// mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on macOS (<${env.BUILD_URL}|Open>)"
- throw err
- }
- }
-}, 'windows': {
- node('windows') {
- try {
- checkout scm
+// throw err
+// }
+// }
+// }, 'windows': {
+// node('windows') {
+// try {
+// checkout scm
- stage('Build Windows') {
- bat '''CALL "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" amd64
-git clean -dfx
-msbuild windows\\ZeroTierOne.sln
-'''
- }
- }
- catch (err) {
- currentBuild.result = "FAILURE"
- slackSend color: '#ff0000', message: "${env.JOB_NAME} broken on Windows (<${env.BUILD_URL}|Open>)"
+// stage('Build Windows') {
+// bat '''CALL "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" amd64
+// git clean -dfx
+// msbuild windows\\ZeroTierOne.sln
+// '''
+// }
+// }
+// catch (err) {
+// currentBuild.result = "FAILURE"
+// mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Windows (<${env.BUILD_URL}|Open>)"
- throw err
- }
- }
+// throw err
+// }
+// }
}
-slackSend color: "#00ff00", message: "${env.JOB_NAME} #${env.BUILD_NUMBER} Complete (<${env.BUILD_URL}|Show More...>)"
+mattermostSend color: "#00ff00", message: "${env.JOB_NAME} #${env.BUILD_NUMBER} Complete (<${env.BUILD_URL}|Show More...>)"
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..3807fea
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,37 @@
+ZeroTier One - Network Virtualization Everywhere
+Copyright (C) 2011-2019 ZeroTier, Inc. https://www.zerotier.com/
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see .
+
+See LICENSE.GPL-3 for the full GNU GPL v3 license.
+
+--
+
+You can be released from the requirements of the license by purchasing
+a commercial license. Buying such a license is mandatory as soon as you
+develop commercial closed-source software that incorporates or links
+directly against ZeroTier software without disclosing the source code
+of your own application.
+
+--
+
+The above license does not apply to third party code included with or
+linked against by ZeroTier software. See the third party code section
+of the AUTHORS.md for an index of third party software included in
+this software repository.
+
+Licenses for third party code are all relatively permissive: MIT,
+BSD, and public domain. The only exception is the tap-windows driver
+which is under the GPLv2, but this is only needed to produce the
+binary tap device driver used by the ZeroTier service on Windows.
diff --git a/Makefile b/Makefile
index 9511862..144225f 100644
--- a/Makefile
+++ b/Makefile
@@ -22,3 +22,7 @@ ifeq ($(OSTYPE),OpenBSD)
ZT_BUILD_PLATFORM=9
include make-bsd.mk
endif
+
+ifeq ($(OSTYPE),NetBSD)
+ include make-netbsd.mk
+endif
diff --git a/OFFICIAL-RELEASE-STEPS.md b/OFFICIAL-RELEASE-STEPS.md
index d0f42e3..6de3526 100644
--- a/OFFICIAL-RELEASE-STEPS.md
+++ b/OFFICIAL-RELEASE-STEPS.md
@@ -13,7 +13,6 @@ The version must be incremented in all of the following files:
/zerotier-one.spec
/debian/changelog
/ext/installfiles/mac/ZeroTier One.pkgproj
- /ext/installfiles/windows/chocolatey/zerotier-one.nuspec
/ext/installfiles/windows/ZeroTier One.aip
/windows/WinUI/AboutView.xaml
@@ -29,36 +28,6 @@ Mac's easy. Just type:
You will need [Packages](http://s.sudre.free.fr/Software/Packages/about.html) and our release signing key in the keychain.
-## Linux
-
-Mount the GPG key for *contact@zerotier.com* and then on an x86_64 box with a recent version of Docker and an Internet connection run:
-
- make distclean
- cd linux-build-farm
- ./build.sh
-
-This will build i386 and x86_64 packages. Now ssh into our build Raspberry Pi and type `make debian` there to build the Raspbian armhf package. Copy it to `debian-jessie/` inside `linux-build-farm` so that it will be included in the repositories we generate. Now generate the YUM and APT repos:
-
- rm -rf ~/.aptly*
- rm -rf /tmp/zt-rpm-repo
- ./make-apt-repos.sh
- ./make-rpm-repos.sh
-
-This will require the passphrase for *contact@zerotier.com*.
-
-The contents of ~/.aptly/public must be published as `debian/` on `download.zerotier.com`. The contents of /tmp/zt-rpm-repo are published as `redhat/` on same.
-
## Windows
First load the Visual Studio solution and rebuild the UI and ZeroTier One in both x64 and i386 `Release` mode. Then load [Advanced Installer Enterprise](http://www.advancedinstaller.com/), check that the version is correct, and build. The build will fail if any build artifacts are missing, and Windows must have our product singing key (from DigiCert) available to sign the resulting MSI file. The MSI must then be tested on at least a few different CLEAN Windows VMs to ensure that the installer is valid and properly signed.
-
-*After the MSI is published to download.zerotier.com in the proper RELEASE/#.#.#/dist subfolder for its version* the Chocolatey package must be rebuilt and published. Open a command prompt, change to `ext/installfiles/windows/chocolatey`, and type `choco pack`. Then use `choco push` to push it to Chocolatey (API key required).
-
- choco pack
- choco push zerotier-one.#.#.#.nupkg -s https://chocolatey.org/
-
-Note that this does not cover rebuilding the drivers or their containing MSI projects, as this is typically not necessary and they are shipped in binary form in the repository for convenience.
-
-## iOS, Android
-
-... no docs here yet since this is done entirely out of band with regular installs.
diff --git a/README.md b/README.md
index 47bfc87..6fecf2f 100644
--- a/README.md
+++ b/README.md
@@ -1,73 +1,57 @@
-ZeroTier - A Planetary Ethernet Switch
+ZeroTier - Global Area Networking
======
-ZeroTier is an enterprise Ethernet switch for planet Earth.
+ZeroTier is a smart programmable Ethernet switch for planet Earth. It allows networked devices and applications to be managed as if the entire world is one data center or cloud region.
-It erases the LAN/WAN distinction and makes VPNs, tunnels, proxies, and other kludges arising from the inflexible nature of physical networks obsolete. Everything is encrypted end-to-end and traffic takes the most direct (peer to peer) path available.
+It replaces the physical LAN/WAN boundary with a virtual one, allowing devices of any type at any location to be managed as if they all reside in the same cloud region or data center. All traffic is encrypted end-to-end and takes the most direct path available for minimum latency and maximum performance. The goals and design of ZeroTier are inspired by among other things the original [Google BeyondCorp](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43231.pdf) paper and the [Jericho Forum](https://en.wikipedia.org/wiki/Jericho_Forum).
-Visit [ZeroTier's site](https://www.zerotier.com/) for more information and [pre-built binary packages](https://www.zerotier.com/download.shtml). Apps for Android and iOS are available for free in the Google Play and Apple app stores.
+Visit [ZeroTier's site](https://www.zerotier.com/) for more information and [pre-built binary packages](https://www.zerotier.com/download/). Apps for Android and iOS are available for free in the Google Play and Apple app stores.
### Getting Started
-ZeroTier's basic operation is easy to understand. Devices have 10-digit *ZeroTier addresses* like `89e92ceee5` and networks have 16-digit network IDs like `8056c2e21c000001`. All it takes for a device to join a network is its 16-digit ID, and all it takes for a network to authorize a device is its 10-digit address. Everything else is automatic.
+Everything in the ZeroTier world is controlled by two types of identifier: 40-bit/10-digit *ZeroTier addresses* and 64-bit/16-digit *network IDs*. A ZeroTier address identifies a node or "device" (laptop, phone, server, VM, app, etc.) while a network ID identifies a virtual Ethernet network that can be joined by devices.
-A "device" in our terminology is any "unit of compute" capable of talking to a network: desktops, laptops, phones, servers, VMs/VPSes, containers, and even user-space applications via our [SDK](https://github.com/zerotier/ZeroTierSDK).
+Another way of thinking about it is that ZeroTier addresses are port numbers on a giant planetary-sized smart switch while network IDs are VLANs to which these ports can be assigned. For more details read about VL1 and VL2 in [the ZeroTier manual](https://www.zerotier.com/manual/).
-For testing purposes we provide a public virtual network called *Earth* with network ID `8056c2e21c000001`. You can join it with:
-
- sudo zerotier-cli join 8056c2e21c000001
-
-Now wait about 30 seconds and check your system with `ip addr list` or `ifconfig`. You'll see a new interface whose name starts with *zt* and it should quickly get an IPv4 and an IPv6 address. Once you see it get an IP, try pinging `earth.zerotier.net` at `29.209.112.93`. If you've joined Earth from more than one system, try pinging your other machine. If you don't want to belong to a giant Ethernet party line anymore, just type:
-
- sudo zerotier-cli leave 8056c2e21c000001
-
-The *zt* interface will disappear. You're no longer on the network.
-
-To create networks of your own, you'll need a network controller. ZeroTier One (for desktops and servers) includes controller functionality in its default build that can be configured via its JSON API (see [README.md in controller/](controller/)). ZeroTier provides a hosted solution with a nice web UI and SaaS add-ons at [my.zerotier.com](https://my.zerotier.com/). Basic controller functionality is free for up to 100 devices.
+*Network controllers* are ZeroTier nodes that act as access control certificate authorities and configuration managers for virtual networks. The first 40 bits (or 10 digits) of a network ID is the ZeroTier address of its controller. You can create networks with our [hosted controllers](https://my.zerotier.com/) and web UI/API or [host your own](controller/) if you don't mind posting some JSON configuration info or writing a script to do so.
### Project Layout
+The base path contains the ZeroTier One service main entry point (`one.cpp`), self test code, makefiles, etc.
+
- `artwork/`: icons, logos, etc.
- `attic/`: old stuff and experimental code that we want to keep around for reference.
- `controller/`: the reference network controller implementation, which is built and included by default on desktop and server build targets.
- `debian/`: files for building Debian packages on Linux.
- `doc/`: manual pages and other documentation.
+ - `docker/`: Dockerfile to build as a container for containerized Linux systems and Kubernetes clusters.
- `ext/`: third party libraries, binaries that we ship for convenience on some platforms (Mac and Windows), and installation support files.
- `include/`: include files for the ZeroTier core.
- `java/`: a JNI wrapper used with our Android mobile app. (The whole Android app is not open source but may be made so in the future.)
- `macui/`: a Macintosh menu-bar app for controlling ZeroTier One, written in Objective C.
- `node/`: the ZeroTier virtual Ethernet switch core, which is designed to be entirely separate from the rest of the code and able to be built as a stand-alone OS-independent library. Note to developers: do not use C++11 features in here, since we want this to build on old embedded platforms that lack C++11 support. C++11 can be used elsewhere.
- `osdep/`: code to support and integrate with OSes, including platform-specific stuff only built for certain targets.
+ - `rule-compiler/`: JavaScript rules language compiler for defining network-level rules.
- `service/`: the ZeroTier One service, which wraps the ZeroTier core and provides VPN-like connectivity to virtual networks for desktops, laptops, servers, VMs, and containers.
- - `tcp-proxy/`: TCP proxy code run by ZeroTier, Inc. to provide TCP fallback (this will die soon!).
- `windows/`: Visual Studio solution files, Windows service code for ZeroTier One, and the Windows task bar app UI.
-The base path contains the ZeroTier One service main entry point (`one.cpp`), self test code, makefiles, etc.
-
### Build and Platform Notes
To build on Mac and Linux just type `make`. On FreeBSD and OpenBSD `gmake` (GNU make) is required and can be installed from packages or ports. For Windows there is a Visual Studio solution in `windows/'.
- **Mac**
- - Xcode command line tools for OSX 10.7 or newer are required.
- - Tap device driver kext source is in `ext/tap-mac` and a signed pre-built binary can be found in `ext/bin/tap-mac`. You should not need to build it yourself. It's a fork of [tuntaposx](http://tuntaposx.sourceforge.net) with device names changed to `zt#`, support for a larger MTU, and tun functionality removed.
+ - Xcode command line tools for OSX 10.8 or newer are required.
- **Linux**
- - The minimum compiler versions required are GCC/G++ 4.9.3 or CLANG/CLANG++ 3.4.2.
+ - The minimum compiler versions required are GCC/G++ 4.9.3 or CLANG/CLANG++ 3.4.2. (Install `clang` on CentOS 7 as G++ is too old.)
- Linux makefiles automatically detect and prefer clang/clang++ if present as it produces smaller and slightly faster binaries in most cases. You can override by supplying CC and CXX variables on the make command line.
- - CentOS 7 ships with a version of GCC/G++ that is too old, but a new enough version of CLANG can be found in the *epel* repositories. Type `yum install epel-release` and then `yum install clang` to build there.
- **Windows**
- - Windows 7 or newer (and equivalent server versions) are supported. This *may* work on Vista but you're on your own there. Windows XP is not supported since it lacks many important network API functions.
- - We build with Visual Studio 2015. Older versions may not work with the solution file and project files we ship and may not have new enough C++11 support.
- - Pre-built signed Windows drivers are included in `ext/bin/tap-windows-ndis6`. The MSI files found there will install them on 32-bit and 64-bit systems. (These are included in our multi-architecture installer as chained MSIs.)
- - Windows builds are more painful in general than other platforms and are for the adventurous.
+ - Windows 7 or newer is supported. This *may* work on Vista but isn't officially supported there. It will not work on Windows XP.
+ - We build with Visual Studio 2017. Older versions may not work. Clang or MinGW will also probably work but may require some makefile hacking.
- **FreeBSD**
- - Tested most recently on FreeBSD-11. Older versions may work but we're not sure.
- - GCC/G++ 4.9 and gmake are required. These can be installed from packages or ports. Type `gmake` to build.
+ - GNU make is required. Type `gmake` to build.
- **OpenBSD**
- - There is a limit of four network memberships on OpenBSD as there are only four tap devices (`/dev/tap0` through `/dev/tap3`). We're not sure if this can be increased.
- - OpenBSD lacks `getifmaddrs` (or any equivalent method) to get interface multicast memberships. As a result multicast will only work on OpenBSD for ARP and NDP (IP/MAC lookup) and not for other purposes.
- - Only tested on OpenBSD 6.0. Older versions may not work.
- - GCC/G++ 4.9 and gmake are required and can be installed using `pkg_add` or from ports. They get installed in `/usr/local/bin` as `egcc` and `eg++` and our makefile is pre-configured to use them on OpenBSD.
+ - There is a limit of four network memberships on OpenBSD as there are only four tap devices (`/dev/tap0` through `/dev/tap3`).
+ - GNU make is required. Type `gmake` to build.
Typing `make selftest` will build a *zerotier-selftest* binary which unit tests various internals and reports on a few aspects of the build environment. It's a good idea to try this on novel platforms or architectures.
@@ -112,7 +96,7 @@ ZeroTier One peers will automatically locate each other and communicate directly
Users behind certain types of firewalls and "symmetric" NAT devices may not able able to connect to external peers directly at all. ZeroTier has limited support for port prediction and will *attempt* to traverse symmetric NATs, but this doesn't always work. If P2P connectivity fails you'll be bouncing UDP packets off our relay servers resulting in slower performance. Some NAT router(s) have a configurable NAT mode, and setting this to "full cone" will eliminate this problem. If you do this you may also see a magical improvement for things like VoIP phones, Skype, BitTorrent, WebRTC, certain games, etc., since all of these use NAT traversal techniques similar to ours.
-If you're interested, there's a [technical deep dive about NAT traversal on our blog](https://www.zerotier.com/blog/?p=226). A troubleshooting tool to help you diagnose NAT issues is planned for the future as are uPnP/IGD/NAT-PMP and IPv6 transport.
+If you're interested, there's a [technical deep dive about NAT traversal on our blog](https://www.zerotier.com/blog/?p=226?pk_campaign=github_ZeroTierOne). A troubleshooting tool to help you diagnose NAT issues is planned for the future as are uPnP/IGD/NAT-PMP and IPv6 transport.
If a firewall between you and the Internet blocks ZeroTier's UDP traffic, you will fall back to last-resort TCP tunneling to rootservers over port 443 (https impersonation). This will work almost anywhere but is *very slow* compared to UDP or direct peer to peer connectivity.
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 195e888..a781392 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -1,6 +1,86 @@
ZeroTier Release Notes
======
+# 2019-08-12 -- Version 1.4.2
+
+ * Fix high CPU use bug on some platforms
+ * Fix issues with PostgreSQL controller DB (only affects Central)
+ * Restore backward compatibility with MacOS versions prior to 10.13
+
+# 2019-07-29 -- Version 1.4.0
+
+### Major Changes
+
+ * Mac version no longer requires a kernel extension, instead making use of the [feth interfaces](https://apple.stackexchange.com/questions/337715/fake-ethernet-interfaces-feth-if-fake-anyone-ever-seen-this).
+ * Added support for concurrent multipath (multiple paths at once) with traffic weighting by link quality and faster recovery from lost links.
+ * Added under-the-hood support for QoS (not yet exposed) that will eventually be configurable via our rules engine.
+
+### Minor Changes and Bug Fixes
+
+ * Experimental controller DB driver for [LF](https://github.com/zerotier/lf) to store network controller data (LFDB.cpp / LFDB.hpp).
+ * Modified credential push and direct path push timings and algorithms to somewhat reduce "chattiness" of the protocol when idle. More radical background overhead reductions will have to wait for the 2.x line.
+ * Removed our beta/half-baked integration of Central with the Windows UI. We're going to do a whole new UI of some kind in the future at least for Windows and Mac.
+ * Fixed stack overflow issues on Linux versions using musl libc.
+ * Fixed some alignment problems reported on ARM and ARM64, but some reports we could not reproduce so please report any issues with exact chip, OS/distro, and ZeroTier version in use.
+ * Fixed numerous other small issues and bugs such as ARM alignment issues causing crashes on some devices.
+ * Windows now sets the adapter name such that it is consistent in both the Windows UI and command line utilities.
+
+# 2018-07-27 -- Version 1.2.12
+
+ * Fixed a bug that caused exits to take a long time on Mac due to huge numbers of redundant attempts to delete managed routes.
+ * Fixed a socket limit problem on Windows that caused the ZeroTier service to run out of sockets, causing the UI and CLI to be unable to access the API.
+ * Fixed a threading bug in the ZeroTier Core, albeit one that never manifested on the regular ZeroTier One service/client.
+ * Fixed a bug that could cause the service to crash if an authorized local client accessed an invalid URL via the control API. (Not exploitable since you needed admin access anyway.)
+
+# 2018-05-08 -- Version 1.2.10
+
+ * Fix bug loading `moons.d/` files for federated root operation.
+ * Fix compile problem with ZT_DEBUG on some versions of `clang`
+ * Fix slow network startup bug related to loading of `networks.d/` cache files
+
+# 2018-04-27 -- Version 1.2.8
+
+ * Linux version once again builds with PIE (position independent executable) flags
+ * Fixed bug in zerotier-idtool file sign and verify
+ * Fixed minor OSX app typo
+ * Merged alpha NetBSD support (mostly untested, so YMMV)
+ * Merged several minor typo and one-liner bug fixes
+
+# 2018-04-17 -- Version 1.2.6
+
+ * Features and Core Improvements
+ * Path selection has been overhauled to improve path stability, simplify code, and prepare for multi-path and trunking in the next major release.
+ * This version introduces remote tracing for remote diagnostics. Network controllers can set a node (usually the controller itself) to receive remote tracing events from all members of the network or from select members. Events are only sent if they pertain to a given network for security reasons.
+ * Multicast replication can now be done by designated multicast replicators on a network (flagged as such at the controller) rather than by the sender. Most users won't want this, but it's useful for specialized use cases on hub-and-spoke networks and for low-power devices.
+ * Cryptographic performance improvements on several platforms.
+ * Multithreaded performance improvements throughout the code base, including the use of an inline lightweight spinlock for low-contention resources.
+ * Bugs fixed
+ * Disappearing routes on Mac (GitHub issue #600)
+ * Route flapping and path instability in some dual-stack V4/V6 networks
+ * Blacklist (in local.conf) doesn't work reliably (GitHub issue #656)
+ * Connection instabilities due to unsigned integer overflows in timing comparisons (use int64_t instead of uint64_t)
+ * Binaries don't run on some older or lower-end 32-bit ARM chips (build problem)
+ * ARM NEON crypto code crashes (build problem)
+ * Fixed some lock ordering issues revealed by "valgrind" tool
+ * The "zerotier-idtool" command could not be accessed from "zerotier-one" via command line switch
+ * Leaking sockets on some platforms when uPnP/NAT-PMP is enabled
+ * Fixed two very rare multithreading issues that were only observed on certain systems
+ * Platform-Specific Changes
+ * MacOS
+ * Installer now loads the kernel extension right away so that High Sierra users will see the prompt to authorize it. This is done in the "Security & Privacy" preference pane and must be done directly on the console (not via remote desktop). On High Sierra and newer kexts must be authorized at the console via security settings system preferences pane.
+ * Windows
+ * The Windows installer should now install the driver without requiring a special prompt in most cases. This should make it easier for our packages to be accepted into and updated in the Chocolatey repository and should make it easier to perform remote installs across groups of machines using IT management and provisioning tools.
+ * The Windows official packages are now signed with an EV certificate (with hardware key).
+ * The Windows UI can now log into ZeroTier Central and join networks via the Central API.
+ * The `zerotier-idtool` command should now work on Windows without ugly hacks.
+ * Upgraded the installer version.
+ * Made a few changes to hopefully fix sporadic "will not uninstall" problems, though we cannot duplicate these issues ourselves.
+ * Linux
+ * Device names are now generated deterministically based on network IDs for all newly joined networks.
+ * Android
+ * Multicast now works on Android in most cases! Android apps can send and receive multicast and subscribe to multicast group IPs. Note that in some cases the app must bind to the specific correct interface for this to work.
+ * IPv6 can be disabled in UI for cases where it causes problems.
+
# 2017-04-20 -- Version 1.2.4
* Managed routes are now only bifurcated for the default route. This is a change in behavior, though few people will probably notice. Bifurcating all managed routes was causing more trouble than it was worth for most users.
@@ -29,7 +109,7 @@ The largest new feature in 1.2.0, and the product of many months of work, is our
Rules allow you to filter packets on your network and vector traffic to security observers. Security observation can be performed in-band using REDIRECT or out of band using TEE.
-Tags and capabilites provide advanced methods for implementing fine grained permission structures and micro-segmentation schemes without bloating the size and complexity of your rules table.
+Tags and capabilities provide advanced methods for implementing fine grained permission structures and micro-segmentation schemes without bloating the size and complexity of your rules table.
See the [rules engine announcement blog post](https://www.zerotier.com/blog/?p=927) for an in-depth discussion of theory and implementation. The [manual](https://www.zerotier.com/manual.shtml) contains detailed information on rule, tag, and capability use, and the `rule-compiler/` subfolder of the ZeroTier source tree contains a JavaScript function to compile rules in our human-readable rule definition language into rules suitable for import into a network controller. (ZeroTier Central uses this same script to compile rules on [my.zerotier.com](https://my.zerotier.com/).)
@@ -112,7 +192,7 @@ A special kind of public network called an ad-hoc network may be accessed by joi
| Start of port range (hex)
Reserved ZeroTier address prefix indicating a controller-less network
-Ad-hoc networks are public (no access control) networks that have no network controller. Instead their configuration and other credentials are generated locally. Ad-hoc networks permit only IPv6 UDP and TCP unicast traffic (no multicast or broadcast) using 6plane format NDP-emulated IPv6 addresses. In addition an ad-hoc network ID encodes an IP port range. UDP packets and TCP SYN (connection open) packets are only allowed to desintation ports within the encoded range.
+Ad-hoc networks are public (no access control) networks that have no network controller. Instead their configuration and other credentials are generated locally. Ad-hoc networks permit only IPv6 UDP and TCP unicast traffic (no multicast or broadcast) using 6plane format NDP-emulated IPv6 addresses. In addition an ad-hoc network ID encodes an IP port range. UDP packets and TCP SYN (connection open) packets are only allowed to destination ports within the encoded range.
For example `ff00160016000000` is an ad-hoc network allowing only SSH, while `ff0000ffff000000` is an ad-hoc network allowing any UDP or TCP port.
@@ -127,7 +207,7 @@ If you have data in an old SQLite3 controller we've included a NodeJS script in
## Major Bug Fixes in 1.2.0
* **The Windows HyperV 100% CPU bug is FINALLY DEAD**: This long-running problem turns out to have been an issue with Windows itself, but one we were triggering by placing invalid data into the Windows registry. Microsoft is aware of the issue but we've also fixed the triggering problem on our side. ZeroTier should now co-exist quite well with HyperV and should now be able to be bridged with a HyperV virtual switch.
- * **Segmenation faults on musl-libc based Linux systems**: Alpine Linux and some embedded Linux systems that use musl libc (a minimal libc) experienced segmentation faults. These were due to a smaller default stack size. A work-around that sets the stack size for new threads has been added.
+ * **Segmentation faults on musl-libc based Linux systems**: Alpine Linux and some embedded Linux systems that use musl libc (a minimal libc) experienced segmentation faults. These were due to a smaller default stack size. A work-around that sets the stack size for new threads has been added.
* **Windows firewall blocks local JSON API**: On some Windows systems the firewall likes to block 127.0.0.1:9993 for mysterious reasons. This is now fixed in the installer via the addition of another firewall exemption rule.
* **UI crash on embedded Windows due to missing fonts**: The MSI installer now ships fonts and will install them if they are not present, so this should be fixed.
diff --git a/artwork/AppIcon_1024x1024.png b/artwork/AppIcon_1024x1024.png
new file mode 100644
index 0000000..c423c4f
Binary files /dev/null and b/artwork/AppIcon_1024x1024.png differ
diff --git a/artwork/AppIcon_20x20.png b/artwork/AppIcon_20x20.png
new file mode 100644
index 0000000..bb10b47
Binary files /dev/null and b/artwork/AppIcon_20x20.png differ
diff --git a/artwork/AppIcon_60x60.png b/artwork/AppIcon_60x60.png
new file mode 100644
index 0000000..bb46ae7
Binary files /dev/null and b/artwork/AppIcon_60x60.png differ
diff --git a/artwork/AppIcon_90x90.png b/artwork/AppIcon_90x90.png
new file mode 100644
index 0000000..0a618bb
Binary files /dev/null and b/artwork/AppIcon_90x90.png differ
diff --git a/artwork/ZeroTierIcon32x32.png b/artwork/ZeroTierIcon32x32.png
new file mode 100644
index 0000000..24ff0a1
Binary files /dev/null and b/artwork/ZeroTierIcon32x32.png differ
diff --git a/attic/OSXEthernetTap.cpp.pcap-with-bridge-test b/attic/OSXEthernetTap.cpp.pcap-with-bridge-test
deleted file mode 100644
index baae0a4..0000000
--- a/attic/OSXEthernetTap.cpp.pcap-with-bridge-test
+++ /dev/null
@@ -1,650 +0,0 @@
-/*
- * ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2015 ZeroTier, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- * --
- *
- * ZeroTier may be used and distributed under the terms of the GPLv3, which
- * are available at: http://www.gnu.org/licenses/gpl-3.0.html
- *
- * If you would like to embed ZeroTier into a commercial application or
- * redistribute it in a modified binary form, please contact ZeroTier Networks
- * LLC. Start here: http://www.zerotier.com/
- */
-
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-// OSX compile fix... in6_var defines this in a struct which namespaces it for C++ ... why?!?
-struct prf_ra {
- u_char onlink : 1;
- u_char autonomous : 1;
- u_char reserved : 6;
-} prf_ra;
-
-#include
-#include
-
-// These are KERNEL_PRIVATE... why?
-#ifndef SIOCAUTOCONF_START
-#define SIOCAUTOCONF_START _IOWR('i', 132, struct in6_ifreq) /* accept rtadvd on this interface */
-#endif
-#ifndef SIOCAUTOCONF_STOP
-#define SIOCAUTOCONF_STOP _IOWR('i', 133, struct in6_ifreq) /* stop accepting rtadv for this interface */
-#endif
-
-#ifndef ETH_ALEN
-#define ETH_ALEN 6
-#endif
-
-// --------------------------------------------------------------------------
-// --------------------------------------------------------------------------
-// This source is from:
-// http://www.opensource.apple.com/source/Libinfo/Libinfo-406.17/gen.subproj/getifmaddrs.c?txt
-// It's here because OSX 10.6 does not have this convenience function.
-
-#define SALIGN (sizeof(uint32_t) - 1)
-#define SA_RLEN(sa) ((sa)->sa_len ? (((sa)->sa_len + SALIGN) & ~SALIGN) : \
-(SALIGN + 1))
-#define MAX_SYSCTL_TRY 5
-#define RTA_MASKS (RTA_GATEWAY | RTA_IFP | RTA_IFA)
-
-/* FreeBSD uses NET_RT_IFMALIST and RTM_NEWMADDR from */
-/* We can use NET_RT_IFLIST2 and RTM_NEWMADDR2 on Darwin */
-//#define DARWIN_COMPAT
-
-//#ifdef DARWIN_COMPAT
-#define GIM_SYSCTL_MIB NET_RT_IFLIST2
-#define GIM_RTM_ADDR RTM_NEWMADDR2
-//#else
-//#define GIM_SYSCTL_MIB NET_RT_IFMALIST
-//#define GIM_RTM_ADDR RTM_NEWMADDR
-//#endif
-
-// Not in 10.6 includes so use our own
-struct _intl_ifmaddrs {
- struct _intl_ifmaddrs *ifma_next;
- struct sockaddr *ifma_name;
- struct sockaddr *ifma_addr;
- struct sockaddr *ifma_lladdr;
-};
-
-static inline int _intl_getifmaddrs(struct _intl_ifmaddrs **pif)
-{
- int icnt = 1;
- int dcnt = 0;
- int ntry = 0;
- size_t len;
- size_t needed;
- int mib[6];
- int i;
- char *buf;
- char *data;
- char *next;
- char *p;
- struct ifma_msghdr2 *ifmam;
- struct _intl_ifmaddrs *ifa, *ift;
- struct rt_msghdr *rtm;
- struct sockaddr *sa;
-
- mib[0] = CTL_NET;
- mib[1] = PF_ROUTE;
- mib[2] = 0; /* protocol */
- mib[3] = 0; /* wildcard address family */
- mib[4] = GIM_SYSCTL_MIB;
- mib[5] = 0; /* no flags */
- do {
- if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
- return (-1);
- if ((buf = (char *)malloc(needed)) == NULL)
- return (-1);
- if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
- if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) {
- free(buf);
- return (-1);
- }
- free(buf);
- buf = NULL;
- }
- } while (buf == NULL);
-
- for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
- rtm = (struct rt_msghdr *)(void *)next;
- if (rtm->rtm_version != RTM_VERSION)
- continue;
- switch (rtm->rtm_type) {
- case GIM_RTM_ADDR:
- ifmam = (struct ifma_msghdr2 *)(void *)rtm;
- if ((ifmam->ifmam_addrs & RTA_IFA) == 0)
- break;
- icnt++;
- p = (char *)(ifmam + 1);
- for (i = 0; i < RTAX_MAX; i++) {
- if ((RTA_MASKS & ifmam->ifmam_addrs &
- (1 << i)) == 0)
- continue;
- sa = (struct sockaddr *)(void *)p;
- len = SA_RLEN(sa);
- dcnt += len;
- p += len;
- }
- break;
- }
- }
-
- data = (char *)malloc(sizeof(struct _intl_ifmaddrs) * icnt + dcnt);
- if (data == NULL) {
- free(buf);
- return (-1);
- }
-
- ifa = (struct _intl_ifmaddrs *)(void *)data;
- data += sizeof(struct _intl_ifmaddrs) * icnt;
-
- memset(ifa, 0, sizeof(struct _intl_ifmaddrs) * icnt);
- ift = ifa;
-
- for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
- rtm = (struct rt_msghdr *)(void *)next;
- if (rtm->rtm_version != RTM_VERSION)
- continue;
-
- switch (rtm->rtm_type) {
- case GIM_RTM_ADDR:
- ifmam = (struct ifma_msghdr2 *)(void *)rtm;
- if ((ifmam->ifmam_addrs & RTA_IFA) == 0)
- break;
-
- p = (char *)(ifmam + 1);
- for (i = 0; i < RTAX_MAX; i++) {
- if ((RTA_MASKS & ifmam->ifmam_addrs &
- (1 << i)) == 0)
- continue;
- sa = (struct sockaddr *)(void *)p;
- len = SA_RLEN(sa);
- switch (i) {
- case RTAX_GATEWAY:
- ift->ifma_lladdr =
- (struct sockaddr *)(void *)data;
- memcpy(data, p, len);
- data += len;
- break;
-
- case RTAX_IFP:
- ift->ifma_name =
- (struct sockaddr *)(void *)data;
- memcpy(data, p, len);
- data += len;
- break;
-
- case RTAX_IFA:
- ift->ifma_addr =
- (struct sockaddr *)(void *)data;
- memcpy(data, p, len);
- data += len;
- break;
-
- default:
- data += len;
- break;
- }
- p += len;
- }
- ift->ifma_next = ift + 1;
- ift = ift->ifma_next;
- break;
- }
- }
-
- free(buf);
-
- if (ift > ifa) {
- ift--;
- ift->ifma_next = NULL;
- *pif = ifa;
- } else {
- *pif = NULL;
- free(ifa);
- }
- return (0);
-}
-
-static inline void _intl_freeifmaddrs(struct _intl_ifmaddrs *ifmp)
-{
- free(ifmp);
-}
-
-// --------------------------------------------------------------------------
-// --------------------------------------------------------------------------
-
-#include
-#include