mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2026-09-22 15:29:03 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
327eb9013b | ||
|
|
42f290b037 | ||
|
|
78eb35010f | ||
|
|
fd9afdce34 | ||
|
|
21e4e2924e | ||
|
|
557b92a167 | ||
|
|
e299eea2b1 | ||
|
|
e1f1d05e08 | ||
|
|
2d49931300 | ||
|
|
8426677c55 | ||
|
|
f8359f554b | ||
|
|
cb6a99408c | ||
|
|
72533cbd13 | ||
|
|
c974a159af | ||
|
+6 |
54efb62731 | ||
|
|
464bca5d20 | ||
|
|
7637ef10d7 | ||
|
|
ffb63f3ee5 | ||
|
|
0859a0d1e5 | ||
|
|
e41a6f2ec4 | ||
|
|
c53c6bd9c3 | ||
|
|
707d7deed2 | ||
|
|
ed0a388bcd | ||
|
|
826a1ee346 | ||
|
|
d4e63fcdfe | ||
|
|
0806b881ea | ||
|
|
ead68038a3 | ||
|
|
b8b5d0bff8 | ||
|
|
e18172d434 | ||
|
|
a15883d49b | ||
|
|
1d095e81d9 | ||
|
|
d976a9f5a0 | ||
|
|
f2060e0c76 | ||
|
|
b81ad9a84d | ||
|
|
53bc05fe89 | ||
|
|
a6d5c452d5 | ||
|
|
515fdc22a5 | ||
|
|
424e276150 | ||
|
|
b071d6bbec | ||
|
|
27a9cc6254 | ||
|
|
bb9ad5e41a | ||
|
|
d91f80464d | ||
|
|
d826ddb294 | ||
|
|
a7600c8072 | ||
|
|
82a9122fc3 | ||
|
|
0e9e7f2ebc | ||
|
|
14671009f8 | ||
|
|
0bc10923a1 | ||
|
|
c6f07ee19f | ||
|
|
e36127283c | ||
|
|
230ae6bd16 | ||
|
|
5b5ef07350 | ||
|
|
fb6af1971b | ||
|
|
41f9bdc5db | ||
|
|
12e64aa191 | ||
|
|
22ab673480 | ||
|
|
03841dcb81 | ||
|
|
64c2634b71 | ||
|
|
f1019dc4ee | ||
|
|
50ede37a58 | ||
|
|
60ddca1354 | ||
|
|
19f1f02d91 | ||
|
|
5a36b315a3 | ||
|
|
b67cd2cf7a | ||
|
|
97492eec7c | ||
|
|
fdc2e0f692 | ||
|
|
2672d037a8 | ||
|
|
ee663d61cd | ||
|
|
008a768f15 | ||
|
|
33b2e6a856 | ||
|
|
6540107ccb | ||
|
|
1ce08a62a9 | ||
|
|
b82bdc7782 | ||
|
|
e0e21dfdda | ||
|
|
981d09cc28 | ||
|
|
2fbd5dc828 | ||
|
|
931b02dbb1 | ||
|
|
0962af5e72 | ||
|
|
9b7d13476f | ||
|
|
3efb731b40 | ||
|
|
ce989d0d67 | ||
|
|
405f96c4b7 | ||
|
|
5ad0212b93 | ||
|
|
30799dd73f | ||
|
|
8ebe2c563a | ||
|
|
57588dec7a | ||
|
|
9a8b74d744 | ||
|
|
e11d70e408 | ||
|
|
60d2138f30 | ||
|
|
259ee610a6 | ||
|
|
4192f6a6d9 | ||
|
|
54decda7a4 | ||
|
|
f42841a6ab | ||
|
|
524363dcf7 | ||
|
|
17f6b3a10b | ||
|
|
da71e2524c | ||
|
|
f3da2b4031 | ||
|
|
e2dad367b4 | ||
|
|
9b7ff43118 | ||
|
|
adfbbc3fb0 | ||
|
|
f621261ff9 | ||
|
|
00d55fc4b4 | ||
|
|
74dc41c7c7 | ||
|
|
925599cab0 | ||
|
|
a43048a1ad | ||
|
|
d6c5a6cd59 | ||
|
|
54f339f0c0 | ||
|
|
115b9147b9 | ||
|
|
6b5c9b1b8e | ||
|
|
06b487119d | ||
|
|
4ca3f27293 | ||
|
|
785a121825 | ||
|
|
f73e51e94c | ||
|
|
e6802690b8 | ||
|
|
595e033776 | ||
|
|
e5fc89821f | ||
|
|
411e54023a | ||
|
|
8f05c85838 | ||
|
|
e4cb74896b | ||
|
|
8e6e4ede6d | ||
|
|
0b03ad9a21 | ||
|
|
0e6a314d86 | ||
|
|
1b59712c48 | ||
|
|
7c8d5b0afd | ||
|
|
7f63d896f9 | ||
|
|
2115b18ae3 | ||
|
|
4ac3e7b864 | ||
|
|
03bd96d1d1 | ||
|
|
4a85cf5e74 | ||
|
|
a8fde9e530 | ||
|
|
1f9a15dd18 | ||
|
|
646147c275 | ||
|
|
314099a267 | ||
|
|
ce9330e9bb | ||
|
|
b2a981f353 | ||
|
|
a372619fee | ||
|
|
12cdf39165 | ||
|
|
19c5343a0a | ||
|
|
4a4c8f84d5 | ||
|
|
f94208f493 | ||
|
|
f2cb9b36b2 | ||
|
|
64423f3a09 | ||
|
|
9fb3f04385 | ||
|
|
dd627cd7f4 | ||
|
|
eedf270127 | ||
|
|
a1af94f4e9 | ||
|
|
9f5bf06f95 | ||
|
|
40705caf7e | ||
|
|
9d5b9efc2f | ||
|
|
cc4251c5b7 | ||
|
|
8d74d34f2a | ||
|
|
7f996ea6d5 | ||
|
|
0aa4a4ba7a | ||
|
|
1ab36d891c | ||
|
|
5b5625a6f0 | ||
|
|
33a9cd02ba | ||
|
|
ca73651e12 | ||
|
|
fbd834716f | ||
|
|
914b4fae7b | ||
|
|
a1bf139188 | ||
|
|
a2f753986b | ||
|
|
d28f44335a | ||
|
|
0a925a6f21 | ||
|
|
132bff25df | ||
|
|
e1c16a8e68 | ||
|
|
4ee73fa272 | ||
|
|
30cfe65b39 | ||
|
|
40d5f9b5d2 | ||
|
|
809022b273 | ||
|
|
d0c0585553 | ||
|
|
d60929514b | ||
|
|
920e1f56c2 | ||
|
|
86122e1646 | ||
|
|
f9a27d6778 | ||
|
|
8b0be5c1fc | ||
|
|
686561dc5b | ||
|
|
b8b8e58586 | ||
|
|
54fd7c7e9a | ||
|
|
e060ae3176 | ||
|
|
7392a32cd8 | ||
|
|
8b724493cc | ||
|
|
9cb16accfd | ||
|
|
d5944ae69c | ||
|
|
6102c70855 | ||
|
|
6cc055dbba | ||
|
|
f51ce077a3 | ||
|
|
2de4c95446 | ||
|
|
63f70ba465 | ||
|
|
7ef68a9d6a | ||
|
|
90bf300bd8 | ||
|
|
f9528f1248 | ||
|
|
4861ec5a40 | ||
|
|
acf5b3579b | ||
|
|
d1460ab65b | ||
|
|
85bd773c55 | ||
|
|
ed3918b508 | ||
|
|
7c2766096c | ||
|
|
acd8b95114 | ||
|
|
34ff813e2a | ||
|
|
056cef7292 | ||
|
|
7c5f256d4a | ||
|
|
82749e4442 | ||
|
|
7890185e81 | ||
|
|
71fc0dd097 | ||
|
|
8373a0fa60 | ||
|
|
21264baaae | ||
|
|
703f9290c9 | ||
|
|
dd1b52c7d9 | ||
|
|
01003617cd | ||
|
|
bfe4bc2894 | ||
|
|
1c88037ea0 | ||
|
|
0027e6bdab | ||
|
|
87edbb2d3a | ||
|
|
5be92a96df | ||
|
|
0733af5239 | ||
|
|
216ed8c8ea | ||
|
|
58e3b8c5ad | ||
|
|
c6adfd9d67 | ||
|
|
672c58be01 | ||
|
|
6cf3b65953 | ||
|
|
936dda4773 | ||
|
|
047e327f01 | ||
|
|
032dc5c108 | ||
|
|
dc54e0e1c4 | ||
|
|
9124b0a7a3 | ||
|
|
67cf4c42d5 |
No files matched your search
@@ -20,6 +20,9 @@ mkdir $TEST_DIR_PREFIX
|
||||
# How long we will wait for ZT to come online before considering it a failure
|
||||
MAX_WAIT_SECS=30
|
||||
|
||||
ZT_PORT_NODE_1=9996
|
||||
ZT_PORT_NODE_2=9997
|
||||
|
||||
################################################################################
|
||||
# Multi-node connectivity and performance test #
|
||||
################################################################################
|
||||
@@ -99,14 +102,19 @@ test() {
|
||||
--xml=yes \
|
||||
--xml-file=$FILENAME_MEMORY_LOG \
|
||||
--leak-check=full \
|
||||
./zerotier-one node1 -p9996 -U >>node_1.log 2>&1 &
|
||||
./zerotier-one node1 -p$ZT_PORT_NODE_1 -U >>node_1.log 2>&1 &
|
||||
|
||||
# Second instance, not run in memory profiler
|
||||
# Don't set up internet access until _after_ zerotier is running
|
||||
# This has been a source of stuckness in the past.
|
||||
$NS2 ip addr del 192.168.1.2/24 dev veth3
|
||||
$NS2 sudo ./zerotier-one node2 -U -p9997 >>node_2.log 2>&1 &
|
||||
sleep 1;
|
||||
$NS2 sudo ./zerotier-one node2 -U -p$ZT_PORT_NODE_2 >>node_2.log 2>&1 &
|
||||
|
||||
sleep 10; # New HTTP control plane is a bit sluggish, so we delay here
|
||||
|
||||
check_bind_to_correct_ports $ZT_PORT_NODE_1
|
||||
check_bind_to_correct_ports $ZT_PORT_NODE_2
|
||||
|
||||
$NS2 ip addr add 192.168.1.2/24 dev veth3
|
||||
$NS2 ip route add default via 192.168.1.1
|
||||
|
||||
@@ -458,4 +466,32 @@ check_exit_on_invalid_identity() {
|
||||
fi
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Check that we're binding to the primary port for TCP/TCP6/UDP #
|
||||
################################################################################
|
||||
|
||||
check_bind_to_correct_ports() {
|
||||
PORT_NUMBER=$1
|
||||
echo "Checking bound ports:"
|
||||
sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier"
|
||||
if [[ $(sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier" | grep "tcp") ]];
|
||||
then
|
||||
:
|
||||
else
|
||||
exit_test_and_generate_report $TEST_FAIL "ZeroTier did not bind to tcp/$1"
|
||||
fi
|
||||
if [[ $(sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier" | grep "tcp6") ]];
|
||||
then
|
||||
:
|
||||
else
|
||||
exit_test_and_generate_report $TEST_FAIL "ZeroTier did not bind to tcp6/$1"
|
||||
fi
|
||||
if [[ $(sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier" | grep "udp") ]];
|
||||
then
|
||||
:
|
||||
else
|
||||
exit_test_and_generate_report $TEST_FAIL "ZeroTier did not bind to udp/$1"
|
||||
fi
|
||||
}
|
||||
|
||||
test "$@"
|
||||
@@ -120,7 +120,7 @@ Access control is via the ZeroTier control interface itself and `metricstoken.se
|
||||
curl -H "X-ZT1-Auth: $(sudo cat /var/lib/zerotier-one/metricstoken.secret)" http://localhost:9993/metrics
|
||||
|
||||
// macOS
|
||||
curl -H "X-XT1-Auth: $(sudo cat /Library/Application\ Support/ZeroTier/One/metricstoken.secret)" http://localhost:9993/metrics
|
||||
curl -H "X-ZT1-Auth: $(sudo cat /Library/Application\ Support/ZeroTier/One/metricstoken.secret)" http://localhost:9993/metrics
|
||||
|
||||
// Windows PowerShell (Admin)
|
||||
Invoke-RestMethod -Headers @{'X-ZT1-Auth' = "$(Get-Content C:\ProgramData\ZeroTier\One\metricstoken.secret)"; } -Uri http://localhost:9993/metrics
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
ZeroTier Release Notes
|
||||
======
|
||||
|
||||
# 2023-09-12 -- Version 1.12.2
|
||||
|
||||
* More improvements to macOS full tunnel mode.
|
||||
* Faster recovery after changes to physical network settings.
|
||||
|
||||
# 2023-08-25 -- Version 1.12.1
|
||||
|
||||
* Minor release to fix a port binding issue in Linux.
|
||||
* Update Debian dependencies.
|
||||
* No changes for other platforms.
|
||||
|
||||
# 2023-08-23 -- Version 1.12.0
|
||||
|
||||
* Experimental Windows ARM64 support
|
||||
|
||||
@@ -863,9 +863,38 @@ std::string EmbeddedNetworkController::networkUpdateFromPostData(uint64_t networ
|
||||
|
||||
void EmbeddedNetworkController::configureHTTPControlPlane(
|
||||
httplib::Server &s,
|
||||
httplib::Server &sv6,
|
||||
const std::function<void(const httplib::Request&, httplib::Response&, std::string)> setContent)
|
||||
{
|
||||
s.Get("/controller/network", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
// Control plane Endpoints
|
||||
std::string controllerPath = "/controller";
|
||||
std::string networkListPath = "/controller/network";
|
||||
std::string networkPath = "/controller/network/([0-9a-fA-F]{16})";
|
||||
std::string oldAndBustedNetworkCreatePath = "/controller/network/([0-9a-fA-F]{10})______";
|
||||
std::string memberListPath = "/controller/network/([0-9a-fA-F]{16})/member";
|
||||
std::string memberPath = "/controller/network/([0-9a-fA-F]{16})/member/([0-9a-fA-F]{10})";
|
||||
|
||||
auto controllerGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
char tmp[4096];
|
||||
const bool dbOk = _db.isReady();
|
||||
OSUtils::ztsnprintf(
|
||||
tmp,
|
||||
sizeof(tmp),
|
||||
"{\n\t\"controller\": true,\n\t\"apiVersion\": %d,\n\t\"clock\": %llu,\n\t\"databaseReady\": %s\n}\n",
|
||||
ZT_NETCONF_CONTROLLER_API_VERSION,
|
||||
(unsigned long long)OSUtils::now(),
|
||||
dbOk ? "true" : "false");
|
||||
|
||||
if (!dbOk) {
|
||||
res.status = 503;
|
||||
}
|
||||
|
||||
setContent(req, res, tmp);
|
||||
};
|
||||
s.Get(controllerPath, controllerGet);
|
||||
sv6.Get(controllerPath, controllerGet);
|
||||
|
||||
auto networkListGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
std::set<uint64_t> networkIds;
|
||||
_db.networks(networkIds);
|
||||
char tmp[64];
|
||||
@@ -877,9 +906,11 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
|
||||
}
|
||||
|
||||
setContent(req, res, out.dump());
|
||||
});
|
||||
};
|
||||
s.Get(networkListPath, networkListGet);
|
||||
sv6.Get(networkListPath, networkListGet);
|
||||
|
||||
s.Get("/controller/network/([0-9a-fA-F]{16})", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkID = req.matches[1];
|
||||
uint64_t nwid = Utils::hexStrToU64(networkID.str().c_str());
|
||||
json network;
|
||||
@@ -889,7 +920,9 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
|
||||
}
|
||||
|
||||
setContent(req, res, network.dump());
|
||||
});
|
||||
};
|
||||
s.Get(networkPath, networkGet);
|
||||
sv6.Get(networkPath, networkGet);
|
||||
|
||||
auto createNewNetwork = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
fprintf(stderr, "creating new network (new style)\n");
|
||||
@@ -912,8 +945,10 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
|
||||
|
||||
setContent(req, res, networkUpdateFromPostData(nwid, req.body));
|
||||
};
|
||||
s.Put("/controller/network", createNewNetwork);
|
||||
s.Post("/controller/network", createNewNetwork);
|
||||
s.Put(networkListPath, createNewNetwork);
|
||||
s.Post(networkListPath, createNewNetwork);
|
||||
sv6.Put(networkListPath, createNewNetwork);
|
||||
sv6.Post(networkListPath, createNewNetwork);
|
||||
|
||||
auto createNewNetworkOldAndBusted = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto inID = req.matches[1].str();
|
||||
@@ -941,10 +976,24 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
|
||||
}
|
||||
setContent(req, res, networkUpdateFromPostData(nwid, req.body));
|
||||
};
|
||||
s.Put("/controller/network/([0-9a-fA-F]{10})______", createNewNetworkOldAndBusted);
|
||||
s.Post("/controller/network/([0-9a-fA-F]{10})______", createNewNetworkOldAndBusted);
|
||||
s.Put(oldAndBustedNetworkCreatePath, createNewNetworkOldAndBusted);
|
||||
s.Post(oldAndBustedNetworkCreatePath, createNewNetworkOldAndBusted);
|
||||
sv6.Put(oldAndBustedNetworkCreatePath, createNewNetworkOldAndBusted);
|
||||
sv6.Post(oldAndBustedNetworkCreatePath, createNewNetworkOldAndBusted);
|
||||
|
||||
s.Delete("/controller/network/([0-9a-fA-F]{16})", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkPost = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkID = req.matches[1].str();
|
||||
uint64_t nwid = Utils::hexStrToU64(networkID.c_str());
|
||||
|
||||
res.status = 200;
|
||||
setContent(req, res, networkUpdateFromPostData(nwid, req.body));
|
||||
};
|
||||
s.Put(networkPath, networkPost);
|
||||
s.Post(networkPath, networkPost);
|
||||
sv6.Put(networkPath, networkPost);
|
||||
sv6.Post(networkPath, networkPost);
|
||||
|
||||
auto networkDelete = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkID = req.matches[1].str();
|
||||
uint64_t nwid = Utils::hexStrToU64(networkID.c_str());
|
||||
|
||||
@@ -956,9 +1005,11 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
|
||||
|
||||
_db.eraseNetwork(nwid);
|
||||
setContent(req, res, network.dump());
|
||||
});
|
||||
};
|
||||
s.Delete(networkPath, networkDelete);
|
||||
sv6.Delete(networkPath, networkDelete);
|
||||
|
||||
s.Get("/controller/network/([0-9a-fA-F]{16})/member", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto memberListGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkID = req.matches[1];
|
||||
uint64_t nwid = Utils::hexStrToU64(networkID.str().c_str());
|
||||
json network;
|
||||
@@ -967,24 +1018,24 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
|
||||
return;
|
||||
}
|
||||
|
||||
json out = json::array();
|
||||
json out = json::object();
|
||||
std::vector<json> memTmp;
|
||||
if (_db.get(nwid, network, memTmp)) {
|
||||
for (auto m = memTmp.begin(); m != memTmp.end(); ++m) {
|
||||
int revision = OSUtils::jsonInt((*m)["revision"], 0);
|
||||
std::string id = OSUtils::jsonString((*m)["id"], "");
|
||||
if (id.length() == 10) {
|
||||
json tmp = json::object();
|
||||
tmp[id] = revision;
|
||||
out.push_back(tmp);
|
||||
out[id] = revision;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setContent(req, res, out.dump());
|
||||
});
|
||||
};
|
||||
s.Get(memberListPath, memberListGet);
|
||||
sv6.Get(memberListPath, memberListGet);
|
||||
|
||||
s.Get("/controller/network/([0-9a-fA-F]{16})/member/([0-9a-fA-F]{10})", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto memberGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkID = req.matches[1];
|
||||
auto memberID = req.matches[2];
|
||||
uint64_t nwid = Utils::hexStrToU64(networkID.str().c_str());
|
||||
@@ -997,7 +1048,9 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
|
||||
}
|
||||
|
||||
setContent(req, res, member.dump());
|
||||
});
|
||||
};
|
||||
s.Get(memberPath, memberGet);
|
||||
sv6.Get(memberPath, memberGet);
|
||||
|
||||
auto memberPost = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkID = req.matches[1].str();
|
||||
@@ -1102,10 +1155,12 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
|
||||
|
||||
setContent(req, res, member.dump());
|
||||
};
|
||||
s.Put("/controller/network/([0-9a-fA-F]{16})/member/([0-9a-fA-F]{10})", memberPost);
|
||||
s.Post("/controller/network/([0-9a-fA-F]{16})/member/([0-9a-fA-F]{10})", memberPost);
|
||||
s.Put(memberPath, memberPost);
|
||||
s.Post(memberPath, memberPost);
|
||||
sv6.Put(memberPath, memberPost);
|
||||
sv6.Post(memberPath, memberPost);
|
||||
|
||||
s.Delete("/controller/network/([0-9a-fA-F]{16})/member/([0-9a-fA-F]{10})", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto memberDelete = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkID = req.matches[1].str();
|
||||
auto memberID = req.matches[2].str();
|
||||
|
||||
@@ -1126,7 +1181,9 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
|
||||
_db.eraseMember(nwid, address);
|
||||
|
||||
setContent(req, res, member.dump());
|
||||
});
|
||||
};
|
||||
s.Delete(memberPath, memberDelete);
|
||||
sv6.Delete(memberPath, memberDelete);
|
||||
}
|
||||
|
||||
void EmbeddedNetworkController::handleRemoteTrace(const ZT_RemoteTrace &rt)
|
||||
|
||||
@@ -70,6 +70,7 @@ public:
|
||||
|
||||
void configureHTTPControlPlane(
|
||||
httplib::Server &s,
|
||||
httplib::Server &sV6,
|
||||
const std::function<void(const httplib::Request&, httplib::Response&, std::string)>);
|
||||
|
||||
void handleRemoteTrace(const ZT_RemoteTrace &rt);
|
||||
|
||||
Vendored
+12
@@ -1,3 +1,15 @@
|
||||
zerotier-one (1.12.2) unstable; urgency=medium
|
||||
|
||||
* See RELEASE-NOTES.md for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 12 Sep 2023 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.12.1) unstable; urgency=medium
|
||||
|
||||
* See RELEASE-NOTES.md for release notes.
|
||||
|
||||
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 25 Aug 2023 01:00:00 -0700
|
||||
|
||||
zerotier-one (1.12.0) unstable; urgency=medium
|
||||
|
||||
* See RELEASE-NOTES.md for release notes.
|
||||
|
||||
Vendored
+1
-1
@@ -10,7 +10,7 @@ Homepage: https://www.zerotier.com/
|
||||
|
||||
Package: zerotier-one
|
||||
Architecture: any
|
||||
Depends: iproute2, adduser, libstdc++6 (>= 5), openssl
|
||||
Depends: adduser, libstdc++6 (>= 5), openssl
|
||||
Homepage: https://www.zerotier.com/
|
||||
Description: ZeroTier network virtualization service
|
||||
ZeroTier One lets you join ZeroTier virtual networks and
|
||||
|
||||
Vendored
+1
-1
@@ -10,7 +10,7 @@ Homepage: https://www.zerotier.com/
|
||||
|
||||
Package: zerotier-one
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, iproute, libstdc++6
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libstdc++6
|
||||
Homepage: https://www.zerotier.com/
|
||||
Description: ZeroTier network virtualization service
|
||||
ZeroTier One lets you join ZeroTier virtual networks and
|
||||
|
||||
File mode changed.
File mode changed.
@@ -701,7 +701,7 @@
|
||||
<key>USE_HFS+_COMPRESSION</key>
|
||||
<false/>
|
||||
<key>VERSION</key>
|
||||
<string>1.12.0</string>
|
||||
<string>1.12.2</string>
|
||||
</dict>
|
||||
<key>TYPE</key>
|
||||
<integer>0</integer>
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
<ROW Property="AiFeatIcoZeroTierOne" Value="ZeroTierIcon.exe" Type="8"/>
|
||||
<ROW Property="MSIFASTINSTALL" MultiBuildValue="DefaultBuild:2"/>
|
||||
<ROW Property="Manufacturer" Value="ZeroTier, Inc."/>
|
||||
<ROW Property="ProductCode" Value="1033:{B07D0036-6C23-4CFD-9F2A-F2C990225591} " Type="16"/>
|
||||
<ROW Property="ProductCode" Value="1033:{56528063-D8C2-43F4-97DB-C787E6A2D9DB} " Type="16"/>
|
||||
<ROW Property="ProductLanguage" Value="1033"/>
|
||||
<ROW Property="ProductName" Value="ZeroTier One"/>
|
||||
<ROW Property="ProductVersion" Value="1.12.0" Options="32"/>
|
||||
<ROW Property="ProductVersion" Value="1.12.2" Options="32"/>
|
||||
<ROW Property="REBOOT" MultiBuildValue="DefaultBuild:ReallySuppress"/>
|
||||
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/>
|
||||
<ROW Property="UpgradeCode" Value="{B0E2A5F3-88B6-4E77-B922-CB4739B4C4C8}"/>
|
||||
@@ -62,7 +62,7 @@
|
||||
<ROW Directory="regid.201001.com.zerotier_Dir" Directory_Parent="CommonAppDataFolder" DefaultDir="REGID2~1.ZER|regid.2010-01.com.zerotier" DirectoryOptions="12"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
|
||||
<ROW Component="AI_CustomARPName" ComponentId="{0C83327B-255D-4E69-A702-EC9414459A68}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
|
||||
<ROW Component="AI_CustomARPName" ComponentId="{A0629900-689C-4BD7-9315-85F05804DF03}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
|
||||
<ROW Component="AI_DisableModify" ComponentId="{46FFA8C5-A0CB-4E05-9AD3-911D543DE8CA}" Directory_="APPDIR" Attributes="4" KeyPath="NoModify" Options="1"/>
|
||||
<ROW Component="AI_ExePath" ComponentId="{8E02B36C-7A19-429B-A93E-77A9261AC918}" Directory_="APPDIR" Attributes="4" KeyPath="AI_ExePath"/>
|
||||
<ROW Component="APPDIR" ComponentId="{4DD7907D-D7FE-4CD6-B1A0-B5C1625F5133}" Directory_="APPDIR" Attributes="0"/>
|
||||
@@ -352,8 +352,8 @@
|
||||
<ROW Action="AI_DATA_SETTER_1" Condition="(REMOVE)" Sequence="3101"/>
|
||||
<ROW Action="InstallFinalize" Sequence="6605" SeqType="0" MsiKey="InstallFinalize"/>
|
||||
<ROW Action="AI_RemoveExternalUIStub" Condition="(REMOVE="ALL") AND ((VersionNT > 500) OR((VersionNT = 500) AND (ServicePackLevel >= 4)))" Sequence="1501"/>
|
||||
<ROW Action="TapDeviceRemove32" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE ) AND ( NOT VersionNT64 )" Sequence="1605"/>
|
||||
<ROW Action="TapDeviceRemove64" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE ) AND ( VersionNT64 )" Sequence="1606"/>
|
||||
<ROW Action="TapDeviceRemove32" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE ) AND ( NOT VersionNT64 )" Sequence="1601"/>
|
||||
<ROW Action="TapDeviceRemove64" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE ) AND ( VersionNT64 )" Sequence="1602"/>
|
||||
<ROW Action="AI_FwInstall" Condition="(VersionNT >= 501) AND (REMOVE <> "ALL")" Sequence="5802"/>
|
||||
<ROW Action="AI_DATA_SETTER_2" Condition="(VersionNT >= 501) AND (REMOVE <> "ALL")" Sequence="5801"/>
|
||||
<ROW Action="AI_FwUninstall" Condition="(VersionNT >= 501) AND (REMOVE="ALL")" Sequence="1702"/>
|
||||
@@ -368,17 +368,17 @@
|
||||
<ROW Action="AI_ExtractLzma" Condition="SETUPEXEDIR="" AND Installed AND (REMOVE<>"ALL") AND (AI_INSTALL_MODE<>"Remove") AND (NOT PATCH)" Sequence="1549" Builds="ExeBuild"/>
|
||||
<ROW Action="AI_DeleteRLzma" Condition="SETUPEXEDIR="" AND Installed AND (REMOVE<>"ALL") AND (AI_INSTALL_MODE<>"Remove") AND (NOT PATCH)" Sequence="1548" Builds="ExeBuild"/>
|
||||
<ROW Action="AI_DeleteLzma" Condition="SETUPEXEDIR="" AND Installed AND (REMOVE<>"ALL") AND (AI_INSTALL_MODE<>"Remove") AND (NOT PATCH)" Sequence="6594" Builds="ExeBuild"/>
|
||||
<ROW Action="TerminateUIOld" Sequence="1602"/>
|
||||
<ROW Action="AI_DATA_SETTER_6" Sequence="1601"/>
|
||||
<ROW Action="AI_EnableDebugLog" Sequence="52"/>
|
||||
<ROW Action="AI_ExtractFiles" Sequence="1399" Builds="ExeBuild"/>
|
||||
<ROW Action="AI_DATA_SETTER_4" Sequence="1398"/>
|
||||
<ROW Action="AI_GetArpIconPath" Sequence="1401"/>
|
||||
<ROW Action="TerminateUINew" Sequence="1604"/>
|
||||
<ROW Action="AI_DATA_SETTER_5" Sequence="1603"/>
|
||||
<ROW Action="LaunchUI" Condition="( NOT Installed ) AND ( ZTHEADLESS = "No" )" Sequence="6606"/>
|
||||
<ROW Action="AI_DETECT_MODERNWIN" Condition="(VersionNT >= 603)" Sequence="55" MsiKey="AI_DETECT_MODERNWIN"/>
|
||||
<ROW Action="AI_ResolveLocalizedCredentials" Sequence="51"/>
|
||||
<ROW Action="TerminateUIOld" Sequence="202"/>
|
||||
<ROW Action="AI_DATA_SETTER_6" Sequence="201"/>
|
||||
<ROW Action="TerminateUINew" Sequence="204"/>
|
||||
<ROW Action="AI_DATA_SETTER_5" Sequence="203"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiInstallUISequenceComponent">
|
||||
<ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=""" Sequence="749"/>
|
||||
@@ -498,7 +498,7 @@
|
||||
<ROW XmlAttribute="xsischemaLocation" XmlElement="swidsoftware_identification_tag" Name="xsi:schemaLocation" Flags="14" Order="3" Value="http://standards.iso.org/iso/19770/-2/2008/schema.xsd software_identification_tag.xsd"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.XmlElementComponent">
|
||||
<ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Condition="1" Order="2" Flags="14" Text="0" UpdateIndexInParent="0"/>
|
||||
<ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Condition="1" Order="2" Flags="14" Text="2" UpdateIndexInParent="0"/>
|
||||
<ROW XmlElement="swidentitlement_required_indicator" ParentElement="swidsoftware_identification_tag" Name="swid:entitlement_required_indicator" Condition="1" Order="0" Flags="14" Text="false" UpdateIndexInParent="0"/>
|
||||
<ROW XmlElement="swidmajor" ParentElement="swidnumeric" Name="swid:major" Condition="1" Order="0" Flags="14" Text="1" UpdateIndexInParent="0"/>
|
||||
<ROW XmlElement="swidminor" ParentElement="swidnumeric" Name="swid:minor" Condition="1" Order="1" Flags="14" Text="12" UpdateIndexInParent="0"/>
|
||||
|
||||
+22
-2
@@ -509,7 +509,17 @@ void Switch::onLocalEthernet(void *tPtr,const SharedPtr<Network> &network,const
|
||||
adv[42] = (checksum >> 8) & 0xff;
|
||||
adv[43] = checksum & 0xff;
|
||||
|
||||
RR->node->putFrame(tPtr,network->id(),network->userPtr(),peerMac,from,ZT_ETHERTYPE_IPV6,0,adv,72);
|
||||
//
|
||||
// call on separate background thread
|
||||
// this prevents problems related to trying to do rx while inside of doing tx, such as acquiring same lock recursively
|
||||
//
|
||||
|
||||
std::thread([=]() {
|
||||
|
||||
RR->node->putFrame(tPtr, network->id(), network->userPtr(), peerMac, from, ZT_ETHERTYPE_IPV6, 0, adv, 72);
|
||||
|
||||
}).detach();
|
||||
|
||||
return; // NDP emulation done. We have forged a "fake" reply, so no need to send actual NDP query.
|
||||
} // else no NDP emulation
|
||||
} // else no NDP emulation
|
||||
@@ -546,8 +556,18 @@ void Switch::onLocalEthernet(void *tPtr,const SharedPtr<Network> &network,const
|
||||
data,
|
||||
len);
|
||||
} else if (to == network->mac()) {
|
||||
|
||||
// Destination is this node, so just reinject it
|
||||
RR->node->putFrame(tPtr,network->id(),network->userPtr(),from,to,etherType,vlanId,data,len);
|
||||
|
||||
//
|
||||
// same pattern as putFrame call above
|
||||
//
|
||||
std::thread([=]() {
|
||||
|
||||
RR->node->putFrame(tPtr, network->id(), network->userPtr(), from, to, etherType, vlanId, data, len);
|
||||
|
||||
}).detach();
|
||||
|
||||
} else if (to[0] == MAC::firstOctetForNetwork(network->id())) {
|
||||
// Destination is another ZeroTier peer on the same network
|
||||
|
||||
|
||||
+5
-15
@@ -87,11 +87,10 @@ namespace ZeroTier {
|
||||
class Binder {
|
||||
private:
|
||||
struct _Binding {
|
||||
_Binding() : udpSock((PhySocket*)0), tcpListenSock((PhySocket*)0)
|
||||
_Binding() : udpSock((PhySocket*)0)
|
||||
{
|
||||
}
|
||||
PhySocket* udpSock;
|
||||
PhySocket* tcpListenSock;
|
||||
InetAddress address;
|
||||
char ifname[256] = {};
|
||||
};
|
||||
@@ -111,7 +110,6 @@ class Binder {
|
||||
Mutex::Lock _l(_lock);
|
||||
for (unsigned int b = 0, c = _bindingCount; b < c; ++b) {
|
||||
phy.close(_bindings[b].udpSock, false);
|
||||
phy.close(_bindings[b].tcpListenSock, false);
|
||||
}
|
||||
_bindingCount = 0;
|
||||
}
|
||||
@@ -133,7 +131,7 @@ class Binder {
|
||||
template <typename PHY_HANDLER_TYPE, typename INTERFACE_CHECKER> void refresh(Phy<PHY_HANDLER_TYPE>& phy, unsigned int* ports, unsigned int portCount, const std::vector<InetAddress> explicitBind, INTERFACE_CHECKER& ifChecker)
|
||||
{
|
||||
std::map<InetAddress, std::string> localIfAddrs;
|
||||
PhySocket *udps, *tcps;
|
||||
PhySocket *udps;
|
||||
Mutex::Lock _l(_lock);
|
||||
bool interfacesEnumerated = true;
|
||||
|
||||
@@ -419,11 +417,8 @@ class Binder {
|
||||
}
|
||||
else {
|
||||
PhySocket* const udps = _bindings[b].udpSock;
|
||||
PhySocket* const tcps = _bindings[b].tcpListenSock;
|
||||
_bindings[b].udpSock = (PhySocket*)0;
|
||||
_bindings[b].tcpListenSock = (PhySocket*)0;
|
||||
phy.close(udps, false);
|
||||
phy.close(tcps, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,24 +432,20 @@ class Binder {
|
||||
}
|
||||
if (bi == _bindingCount) {
|
||||
udps = phy.udpBind(reinterpret_cast<const struct sockaddr*>(&(ii->first)), (void*)0, ZT_UDP_DESIRED_BUF_SIZE);
|
||||
tcps = phy.tcpListen(reinterpret_cast<const struct sockaddr*>(&(ii->first)), (void*)0);
|
||||
if ((udps) && (tcps)) {
|
||||
if (udps) {
|
||||
#ifdef __LINUX__
|
||||
// Bind Linux sockets to their device so routes that we manage do not override physical routes (wish all platforms had this!)
|
||||
if (ii->second.length() > 0) {
|
||||
char tmp[256];
|
||||
Utils::scopy(tmp, sizeof(tmp), ii->second.c_str());
|
||||
int fd = (int)Phy<PHY_HANDLER_TYPE>::getDescriptor(udps);
|
||||
if (fd >= 0)
|
||||
setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, tmp, strlen(tmp));
|
||||
fd = (int)Phy<PHY_HANDLER_TYPE>::getDescriptor(tcps);
|
||||
if (fd >= 0)
|
||||
if (fd >= 0) {
|
||||
setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, tmp, strlen(tmp));
|
||||
}
|
||||
}
|
||||
#endif // __LINUX__
|
||||
if (_bindingCount < ZT_BINDER_MAX_BINDINGS) {
|
||||
_bindings[_bindingCount].udpSock = udps;
|
||||
_bindings[_bindingCount].tcpListenSock = tcps;
|
||||
_bindings[_bindingCount].address = ii->first;
|
||||
memcpy(_bindings[_bindingCount].ifname, (char*)ii->second.c_str(), (int)ii->second.length());
|
||||
++_bindingCount;
|
||||
@@ -462,7 +453,6 @@ class Binder {
|
||||
}
|
||||
else {
|
||||
phy.close(udps, false);
|
||||
phy.close(tcps, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+39
-40
@@ -484,58 +484,57 @@ bool ManagedRoute::sync()
|
||||
|
||||
|
||||
if (!hasRoute) {
|
||||
if (_target && _target.netmaskBits() == 0) {
|
||||
if (_target && _target.netmaskBits() == 0) { // Allow Default
|
||||
InetAddress newSystemVia;
|
||||
char newSystemDevice[128];
|
||||
newSystemDevice[0] = (char)0;
|
||||
|
||||
// If macos has a network hiccup, it deletes what _systemVia we had set.
|
||||
// Then we don't know how to set the default route again.
|
||||
// So use the one we had set previously. Don't overwrite it.
|
||||
if (!_systemVia) {
|
||||
// Find system default route that this route should override
|
||||
// We need to put it back when default route is turned off
|
||||
for(std::vector<_RTE>::iterator r(rtes.begin());r!=rtes.end();++r) {
|
||||
if (r->via) {
|
||||
if ( !_systemVia && r->isDefault == 1 && (strcmp(r->device,_device) != 0) ) {
|
||||
|
||||
newSystemVia = r->via;
|
||||
Utils::scopy(newSystemDevice,sizeof(newSystemDevice),r->device);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newSystemVia) { _systemVia = newSystemVia; }
|
||||
// if our routes got deleted
|
||||
// delete the systemd via that we had added with -ifscope
|
||||
if (_systemVia && !!_systemDevice[0]) {
|
||||
_routeCmd("delete",_target,_systemVia,_systemDevice,(const char *)0);
|
||||
}
|
||||
|
||||
_systemVia = newSystemVia;
|
||||
Utils::scopy(_systemDevice,sizeof(_systemDevice),newSystemDevice);
|
||||
// If macos has a network hiccup, it deletes what the route we set, and it's own physical routes.
|
||||
// if !hasRoute (our 0.0.0.0 has been deleted), the OS has changed stuff
|
||||
// So don't assume _systemX are valid anymore. Always get for _system{Via,Device}
|
||||
|
||||
// char buf1[255], buf2[255];
|
||||
// fprintf(stderr, "_systemVia %s new %s\n", _systemVia.toString(buf1), newSystemVia.toString(buf2));
|
||||
if (!_systemVia) { return false; }
|
||||
// Find system default route that this route should override
|
||||
// We need to put it back when default route is turned off
|
||||
for(std::vector<_RTE>::iterator r(rtes.begin());r!=rtes.end();++r) {
|
||||
if (r->via) {
|
||||
if ( r->isDefault == 1 && (strcmp(r->device,_device) != 0) ) {
|
||||
|
||||
if (!_systemDevice[0]) {
|
||||
// Get device corresponding to route if we don't have that already
|
||||
if ((newSystemVia)&&(!newSystemDevice[0])) {
|
||||
rtes = _getRTEs(newSystemVia,true);
|
||||
for(std::vector<_RTE>::iterator r(rtes.begin());r!=rtes.end();++r) {
|
||||
if ( (r->device[0]) && (strcmp(r->device,_device) != 0) && r->target.netmaskBits() != 0) {
|
||||
Utils::scopy(newSystemDevice,sizeof(newSystemDevice),r->device);
|
||||
break;
|
||||
}
|
||||
// char buf[255];
|
||||
// fprintf(stderr, "system device1 %s %s\n", r->via.toString(buf), r->device);
|
||||
|
||||
newSystemVia = r->via;
|
||||
Utils::scopy(newSystemDevice,sizeof(newSystemDevice),r->device);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (newSystemDevice[0]) {
|
||||
Utils::scopy(_systemDevice,sizeof(_systemDevice),newSystemDevice);
|
||||
}
|
||||
}
|
||||
// fprintf(stderr, "_systemDevice %s new %s\n", _systemDevice, newSystemDevice);
|
||||
if (!_systemDevice[0]) { return false; }
|
||||
|
||||
if (newSystemVia) { _systemVia = newSystemVia; }
|
||||
if (newSystemDevice[0]) {
|
||||
Utils::scopy(_systemDevice,sizeof(_systemDevice),newSystemDevice);
|
||||
}
|
||||
|
||||
// if there's no newSystemVia, the OS might not have
|
||||
// ipv4 or ipv6 connectivity.
|
||||
// we should still add our ZeroTier ipv4 or 6 routes though
|
||||
|
||||
if (!!_systemVia && !!_systemDevice[0]) {
|
||||
_routeCmd("delete",_target,_systemVia,(const char *)0,(const char *)0);
|
||||
}
|
||||
|
||||
// Do Default Route route commands
|
||||
_routeCmd("delete",_target,_systemVia,(const char *)0,(const char *)0);
|
||||
_routeCmd("add",_target,_via,(const char *)0,(const char *)0);
|
||||
_routeCmd("add",_target,_systemVia,_systemDevice,(const char *)0);
|
||||
|
||||
if (!!_systemVia && !!_systemDevice[0]) {
|
||||
_routeCmd("add",_target,_systemVia,_systemDevice,(const char *)0);
|
||||
}
|
||||
|
||||
_applied[_target] = true;
|
||||
|
||||
@@ -595,8 +594,8 @@ void ManagedRoute::remove()
|
||||
for(std::map<InetAddress,bool>::iterator r(_applied.begin());r!=_applied.end();++r) {
|
||||
#ifdef __BSD__ // ------------------------------------------------------------
|
||||
if (_target && _target.netmaskBits() == 0) {
|
||||
if (_systemVia) {
|
||||
_routeCmd("delete",_target,_via,(const char *)0,(const char *)0);
|
||||
_routeCmd("delete",_target,_via,(const char *)0,(const char *)0);
|
||||
if (_systemVia && _systemDevice[0]) {
|
||||
_routeCmd("delete",_target,_systemVia,_systemDevice,(const char *)0);
|
||||
|
||||
_routeCmd("add",_target,_systemVia,(const char *)0,(const char *)0);
|
||||
|
||||
+180
-85
@@ -786,8 +786,11 @@ public:
|
||||
bool _updateAutoApply;
|
||||
|
||||
httplib::Server _controlPlane;
|
||||
httplib::Server _controlPlaneV6;
|
||||
std::thread _serverThread;
|
||||
std::thread _serverThreadV6;
|
||||
bool _serverThreadRunning;
|
||||
bool _serverThreadRunningV6;
|
||||
|
||||
bool _allowTcpFallbackRelay;
|
||||
bool _forceTcpRelay;
|
||||
@@ -888,8 +891,11 @@ public:
|
||||
,_updater((SoftwareUpdater *)0)
|
||||
,_updateAutoApply(false)
|
||||
,_controlPlane()
|
||||
,_controlPlaneV6()
|
||||
,_serverThread()
|
||||
,_serverThreadV6()
|
||||
,_serverThreadRunning(false)
|
||||
,_serverThreadRunningV6(false)
|
||||
,_forceTcpRelay(false)
|
||||
,_primaryPort(port)
|
||||
,_udpPortPickerCounter(0)
|
||||
@@ -944,6 +950,10 @@ public:
|
||||
if (_serverThreadRunning) {
|
||||
_serverThread.join();
|
||||
}
|
||||
_controlPlaneV6.stop();
|
||||
if (_serverThreadRunningV6) {
|
||||
_serverThreadV6.join();
|
||||
}
|
||||
|
||||
#ifdef ZT_USE_MINIUPNPC
|
||||
delete _portMapper;
|
||||
@@ -1057,7 +1067,7 @@ public:
|
||||
if (_secondaryPort) {
|
||||
_ports[1] = _secondaryPort;
|
||||
} else {
|
||||
_ports[1] = _secondaryPort = _getRandomPort();
|
||||
_ports[1] = _getRandomPort();
|
||||
}
|
||||
}
|
||||
#ifdef ZT_USE_MINIUPNPC
|
||||
@@ -1119,7 +1129,6 @@ public:
|
||||
int64_t lastBindRefresh = 0;
|
||||
int64_t lastUpdateCheck = clockShouldBe;
|
||||
int64_t lastCleanedPeersDb = 0;
|
||||
int64_t lastLocalInterfaceAddressCheck = (clockShouldBe - ZT_LOCAL_INTERFACE_CHECK_INTERVAL) + 15000; // do this in 15s to give portmapper time to configure and other things time to settle
|
||||
int64_t lastLocalConfFileCheck = OSUtils::now();
|
||||
int64_t lastOnline = lastLocalConfFileCheck;
|
||||
for(;;) {
|
||||
@@ -1166,16 +1175,22 @@ public:
|
||||
// If secondary port is not configured to a constant value and we've been offline for a while,
|
||||
// bind a new secondary port. This is a workaround for a "coma" issue caused by buggy NATs that stop
|
||||
// working on one port after a while.
|
||||
if (_node->online()) {
|
||||
lastOnline = now;
|
||||
} else if ((_secondaryPort == 0)&&((now - lastOnline) > ZT_PATH_HEARTBEAT_PERIOD)) {
|
||||
_secondaryPort = _getRandomPort();
|
||||
lastBindRefresh = 0;
|
||||
if (_secondaryPort == 0) {
|
||||
if (_node->online()) {
|
||||
lastOnline = now;
|
||||
}
|
||||
if ((now - lastOnline) > ZT_PATH_HEARTBEAT_PERIOD || restarted) {
|
||||
_ports[1] = _getRandomPort();
|
||||
#if ZT_DEBUG==1
|
||||
fprintf(stderr, "randomized secondary port. Now it's %d\n", _ports[1]);
|
||||
#endif
|
||||
lastOnline = now; // don't keep spamming this branch. online() will be false for a few seconds
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Refresh bindings in case device's interfaces have changed, and also sync routes to update any shadow routes (e.g. shadow default)
|
||||
if (((now - lastBindRefresh) >= (_node->bondController()->inUse() ? ZT_BINDER_REFRESH_PERIOD / 4 : ZT_BINDER_REFRESH_PERIOD))||(restarted)) {
|
||||
lastBindRefresh = now;
|
||||
if (((now - lastBindRefresh) >= (_node->bondController()->inUse() ? ZT_BINDER_REFRESH_PERIOD / 4 : ZT_BINDER_REFRESH_PERIOD))||restarted) {
|
||||
unsigned int p[3];
|
||||
unsigned int pc = 0;
|
||||
for(int i=0;i<3;++i) {
|
||||
@@ -1186,6 +1201,23 @@ public:
|
||||
// Only bother binding UDP ports if we aren't forcing TCP-relay mode
|
||||
_binder.refresh(_phy,p,pc,explicitBind,*this);
|
||||
}
|
||||
|
||||
lastBindRefresh = now;
|
||||
|
||||
// Sync information about physical network interfaces
|
||||
_node->clearLocalInterfaceAddresses();
|
||||
#ifdef ZT_USE_MINIUPNPC
|
||||
if (_portMapper) {
|
||||
std::vector<InetAddress> mappedAddresses(_portMapper->get());
|
||||
for(std::vector<InetAddress>::const_iterator ext(mappedAddresses.begin());ext!=mappedAddresses.end();++ext)
|
||||
_node->addLocalInterfaceAddress(reinterpret_cast<const struct sockaddr_storage *>(&(*ext)));
|
||||
}
|
||||
#endif
|
||||
std::vector<InetAddress> boundAddrs(_binder.allBoundLocalInterfaceAddresses());
|
||||
for(std::vector<InetAddress>::const_iterator i(boundAddrs.begin());i!=boundAddrs.end();++i) {
|
||||
_node->addLocalInterfaceAddress(reinterpret_cast<const struct sockaddr_storage *>(&(*i)));
|
||||
}
|
||||
|
||||
{
|
||||
Mutex::Lock _l(_nets_m);
|
||||
for(std::map<uint64_t,NetworkState>::iterator n(_nets.begin());n!=_nets.end();++n) {
|
||||
@@ -1229,26 +1261,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// Sync information about physical network interfaces
|
||||
if ((now - lastLocalInterfaceAddressCheck) >= (_node->bondController()->inUse() ? ZT_LOCAL_INTERFACE_CHECK_INTERVAL / 8 : ZT_LOCAL_INTERFACE_CHECK_INTERVAL)) {
|
||||
lastLocalInterfaceAddressCheck = now;
|
||||
|
||||
_node->clearLocalInterfaceAddresses();
|
||||
|
||||
#ifdef ZT_USE_MINIUPNPC
|
||||
if (_portMapper) {
|
||||
std::vector<InetAddress> mappedAddresses(_portMapper->get());
|
||||
for(std::vector<InetAddress>::const_iterator ext(mappedAddresses.begin());ext!=mappedAddresses.end();++ext)
|
||||
_node->addLocalInterfaceAddress(reinterpret_cast<const struct sockaddr_storage *>(&(*ext)));
|
||||
}
|
||||
#endif
|
||||
|
||||
std::vector<InetAddress> boundAddrs(_binder.allBoundLocalInterfaceAddresses());
|
||||
for(std::vector<InetAddress>::const_iterator i(boundAddrs.begin());i!=boundAddrs.end();++i) {
|
||||
_node->addLocalInterfaceAddress(reinterpret_cast<const struct sockaddr_storage *>(&(*i)));
|
||||
}
|
||||
}
|
||||
|
||||
// Clean peers.d periodically
|
||||
if ((now - lastCleanedPeersDb) >= 3600000) {
|
||||
lastCleanedPeersDb = now;
|
||||
@@ -1527,6 +1539,22 @@ public:
|
||||
|
||||
// Internal HTTP Control Plane
|
||||
void startHTTPControlPlane() {
|
||||
// control plane endpoints
|
||||
std::string bondShowPath = "/bond/show/([0-9a-fA-F]{10})";
|
||||
std::string bondRotatePath = "/bond/rotate/([0-9a-fA-F]{10})";
|
||||
std::string setBondMtuPath = "/bond/setmtu/([0-9]{3,5})/([a-zA-Z0-9_]{1,16})/([0-9a-fA-F\\.\\:]{1,39})";
|
||||
std::string configPath = "/config";
|
||||
std::string configPostPath = "/config/settings";
|
||||
std::string healthPath = "/health";
|
||||
std::string moonListPath = "/moon";
|
||||
std::string moonPath = "/moon/([0-9a-fA-F]{10})";
|
||||
std::string networkListPath = "/network";
|
||||
std::string networkPath = "/network/([0-9a-fA-F]{16})";
|
||||
std::string peerListPath = "/peer";
|
||||
std::string peerPath = "/peer/([0-9a-fA-F]{10})";
|
||||
std::string statusPath = "/status";
|
||||
std::string metricsPath = "/metrics";
|
||||
|
||||
std::vector<std::string> noAuthEndpoints { "/sso", "/health" };
|
||||
|
||||
auto setContent = [=] (const httplib::Request &req, httplib::Response &res, std::string content) {
|
||||
@@ -1625,8 +1653,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
|
||||
_controlPlane.Get("/bond/show/([0-9a-fA-F]{10})", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto bondShow = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
if (!_node->bondController()->inUse()) {
|
||||
setContent(req, res, "");
|
||||
res.status = 400;
|
||||
@@ -1652,7 +1679,9 @@ public:
|
||||
}
|
||||
}
|
||||
_node->freeQueryResult((void *)pl);
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(bondShowPath, bondShow);
|
||||
_controlPlaneV6.Get(bondShowPath, bondShow);
|
||||
|
||||
auto bondRotate = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
if (!_node->bondController()->inUse()) {
|
||||
@@ -1675,8 +1704,10 @@ public:
|
||||
}
|
||||
setContent(req, res, "{}");
|
||||
};
|
||||
_controlPlane.Post("/bond/rotate/([0-9a-fA-F]{10})", bondRotate);
|
||||
_controlPlane.Put("/bond/rotate/([0-9a-fA-F]{10})", bondRotate);
|
||||
_controlPlane.Post(bondRotatePath, bondRotate);
|
||||
_controlPlane.Put(bondRotatePath, bondRotate);
|
||||
_controlPlaneV6.Post(bondRotatePath, bondRotate);
|
||||
_controlPlaneV6.Put(bondRotatePath, bondRotate);
|
||||
|
||||
auto setMtu = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
if (!_node->bondController()->inUse()) {
|
||||
@@ -1688,10 +1719,12 @@ public:
|
||||
res.status = _node->bondController()->setAllMtuByTuple(mtu, req.matches[2].str().c_str(), req.matches[3].str().c_str()) ? 200 : 400;
|
||||
setContent(req, res, "{}");
|
||||
};
|
||||
_controlPlane.Post("/bond/setmtu/([0-9]{3,5})/([a-zA-Z0-9_]{1,16})/([0-9a-fA-F\\.\\:]{1,39})", setMtu);
|
||||
_controlPlane.Put("/bond/setmtu/([0-9]{3,5})/([a-zA-Z0-9_]{1,16})/([0-9a-fA-F\\.\\:]{1,39})", setMtu);
|
||||
_controlPlane.Post(setBondMtuPath, setMtu);
|
||||
_controlPlane.Put(setBondMtuPath, setMtu);
|
||||
_controlPlaneV6.Post(setBondMtuPath, setMtu);
|
||||
_controlPlaneV6.Put(setBondMtuPath, setMtu);
|
||||
|
||||
_controlPlane.Get("/config", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto getConfig = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
std::string config;
|
||||
{
|
||||
Mutex::Lock lc(_localConfig_m);
|
||||
@@ -1701,7 +1734,9 @@ public:
|
||||
config = "{}";
|
||||
}
|
||||
setContent(req, res, config);
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(configPath, getConfig);
|
||||
_controlPlaneV6.Get(configPath, getConfig);
|
||||
|
||||
auto configPost = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
json j(OSUtils::jsonParse(req.body));
|
||||
@@ -1718,10 +1753,12 @@ public:
|
||||
}
|
||||
setContent(req, res, "{}");
|
||||
};
|
||||
_controlPlane.Post("/config/settings", configPost);
|
||||
_controlPlane.Put("/config/settings", configPost);
|
||||
_controlPlane.Post(configPostPath, configPost);
|
||||
_controlPlane.Put(configPostPath, configPost);
|
||||
_controlPlaneV6.Post(configPostPath, configPost);
|
||||
_controlPlaneV6.Put(configPostPath, configPost);
|
||||
|
||||
_controlPlane.Get("/health", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto healthGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
json out = json::object();
|
||||
|
||||
char tmp[256];
|
||||
@@ -1739,9 +1776,11 @@ public:
|
||||
out["clock"] = OSUtils::now();
|
||||
|
||||
setContent(req, res, out.dump());
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(healthPath, healthGet);
|
||||
_controlPlaneV6.Get(healthPath, healthGet);
|
||||
|
||||
_controlPlane.Get("/moon", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto moonListGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
std::vector<World> moons(_node->moons());
|
||||
|
||||
auto out = json::array();
|
||||
@@ -1751,9 +1790,11 @@ public:
|
||||
out.push_back(mj);
|
||||
}
|
||||
setContent(req, res, out.dump());
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(moonListPath, moonListGet);
|
||||
_controlPlaneV6.Get(moonListPath, moonListGet);
|
||||
|
||||
_controlPlane.Get("/moon/([0-9a-fA-F]{10})", [&, setContent](const httplib::Request &req, httplib::Response &res){
|
||||
auto moonGet = [&, setContent](const httplib::Request &req, httplib::Response &res){
|
||||
std::vector<World> moons(_node->moons());
|
||||
auto input = req.matches[1];
|
||||
auto out = json::object();
|
||||
@@ -1765,7 +1806,9 @@ public:
|
||||
}
|
||||
}
|
||||
setContent(req, res, out.dump());
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(moonPath, moonGet);
|
||||
_controlPlaneV6.Get(moonPath, moonGet);
|
||||
|
||||
auto moonPost = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto input = req.matches[1];
|
||||
@@ -1804,19 +1847,22 @@ public:
|
||||
}
|
||||
setContent(req, res, out.dump());
|
||||
};
|
||||
_controlPlane.Post("/moon/([0-9a-fA-F]{10})", moonPost);
|
||||
_controlPlane.Put("/moon/([0-9a-fA-F]{10})", moonPost);
|
||||
_controlPlane.Post(moonPath, moonPost);
|
||||
_controlPlane.Put(moonPath, moonPost);
|
||||
_controlPlaneV6.Post(moonPath, moonPost);
|
||||
_controlPlaneV6.Put(moonPath, moonPost);
|
||||
|
||||
_controlPlane.Delete("/moon/([0-9a-fA-F]{10})", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto moonDelete = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto input = req.matches[1];
|
||||
uint64_t id = Utils::hexStrToU64(input.str().c_str());
|
||||
auto out = json::object();
|
||||
_node->deorbit((void*)0,id);
|
||||
out["result"] = true;
|
||||
setContent(req, res, out.dump());
|
||||
});
|
||||
};
|
||||
_controlPlane.Delete(moonPath, moonDelete);
|
||||
|
||||
_controlPlane.Get("/network", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkListGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
Mutex::Lock _l(_nets_m);
|
||||
auto out = json::array();
|
||||
|
||||
@@ -1827,9 +1873,11 @@ public:
|
||||
out.push_back(nj);
|
||||
}
|
||||
setContent(req, res, out.dump());
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(networkListPath, networkListGet);
|
||||
_controlPlaneV6.Get(networkListPath, networkListGet);
|
||||
|
||||
_controlPlane.Get("/network/([0-9a-fA-F]{16})", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
Mutex::Lock _l(_nets_m);
|
||||
|
||||
auto input = req.matches[1];
|
||||
@@ -1843,7 +1891,9 @@ public:
|
||||
}
|
||||
setContent(req, res, "");
|
||||
res.status = 404;
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(networkPath, networkGet);
|
||||
_controlPlaneV6.Get(networkPath, networkGet);
|
||||
|
||||
auto networkPost = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto input = req.matches[1];
|
||||
@@ -1897,10 +1947,12 @@ public:
|
||||
setContent(req, res, out.dump());
|
||||
#endif
|
||||
};
|
||||
_controlPlane.Post("/network/([0-9a-fA-F]{16})", networkPost);
|
||||
_controlPlane.Put("/network/([0-9a-fA-F]){16}", networkPost);
|
||||
_controlPlane.Post(networkPath, networkPost);
|
||||
_controlPlane.Put(networkPath, networkPost);
|
||||
_controlPlaneV6.Post(networkPath, networkPost);
|
||||
_controlPlaneV6.Put(networkPath, networkPost);
|
||||
|
||||
_controlPlane.Delete("/network/([0-9a-fA-F]{16})", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto networkDelete = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto input = req.matches[1];
|
||||
auto out = json::object();
|
||||
ZT_VirtualNetworkList *nws = _node->networks();
|
||||
@@ -1913,9 +1965,11 @@ public:
|
||||
}
|
||||
_node->freeQueryResult((void*)nws);
|
||||
setContent(req, res, out.dump());
|
||||
});
|
||||
};
|
||||
_controlPlane.Delete(networkPath, networkDelete);
|
||||
_controlPlaneV6.Delete(networkPath, networkDelete);
|
||||
|
||||
_controlPlane.Get("/peer", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto peerListGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
ZT_PeerList *pl = _node->peers();
|
||||
auto out = nlohmann::json::array();
|
||||
|
||||
@@ -1931,9 +1985,11 @@ public:
|
||||
}
|
||||
_node->freeQueryResult((void*)pl);
|
||||
setContent(req, res, out.dump());
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(peerListPath, peerListGet);
|
||||
_controlPlaneV6.Get(peerListPath, peerListGet);
|
||||
|
||||
_controlPlane.Get("/peer/([0-9a-fA-F]{10})", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto peerGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
ZT_PeerList *pl = _node->peers();
|
||||
|
||||
auto input = req.matches[1];
|
||||
@@ -1951,9 +2007,11 @@ public:
|
||||
}
|
||||
_node->freeQueryResult((void*)pl);
|
||||
setContent(req, res, out.dump());
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(peerPath, peerGet);
|
||||
_controlPlaneV6.Get(peerPath, peerGet);
|
||||
|
||||
_controlPlane.Get("/status", [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
auto statusGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
|
||||
ZT_NodeStatus status;
|
||||
_node->status(&status);
|
||||
|
||||
@@ -1981,7 +2039,7 @@ public:
|
||||
settings["allowTcpFallbackRelay"] = OSUtils::jsonBool(settings["allowTcpFallbackRelay"],_allowTcpFallbackRelay);
|
||||
settings["forceTcpRelay"] = OSUtils::jsonBool(settings["forceTcpRelay"],_forceTcpRelay);
|
||||
settings["primaryPort"] = OSUtils::jsonInt(settings["primaryPort"],(uint64_t)_primaryPort) & 0xffff;
|
||||
settings["secondaryPort"] = OSUtils::jsonInt(settings["secondaryPort"],(uint64_t)_secondaryPort) & 0xffff;
|
||||
settings["secondaryPort"] = OSUtils::jsonInt(settings["secondaryPort"],(uint64_t)_ports[1]) & 0xffff;
|
||||
settings["tertiaryPort"] = OSUtils::jsonInt(settings["tertiaryPort"],(uint64_t)_tertiaryPort) & 0xffff;
|
||||
// Enumerate all local address/port pairs that this node is listening on
|
||||
std::vector<InetAddress> boundAddrs(_binder.allBoundLocalInterfaceAddresses());
|
||||
@@ -2016,10 +2074,13 @@ public:
|
||||
out["planetWorldTimestamp"] = planet.timestamp();
|
||||
|
||||
setContent(req, res, out.dump());
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(statusPath, statusGet);
|
||||
_controlPlaneV6.Get(statusPath, statusGet);
|
||||
|
||||
#if ZT_SSO_ENABLED
|
||||
_controlPlane.Get("/sso", [this](const httplib::Request &req, httplib::Response &res) {
|
||||
std::string ssoPath = "/sso";
|
||||
auto ssoGet = [this](const httplib::Request &req, httplib::Response &res) {
|
||||
std::string htmlTemplatePath = _homePath + ZT_PATH_SEPARATOR + "sso-auth.template.html";
|
||||
std::string htmlTemplate;
|
||||
if (!OSUtils::readFile(htmlTemplatePath.c_str(), htmlTemplate)) {
|
||||
@@ -2085,10 +2146,11 @@ public:
|
||||
|
||||
zeroidc::free_cstr(ret);
|
||||
}
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(ssoPath, ssoGet);
|
||||
_controlPlaneV6.Get(ssoPath, ssoGet);
|
||||
#endif
|
||||
|
||||
_controlPlane.Get("/metrics", [this](const httplib::Request &req, httplib::Response &res) {
|
||||
auto metricsGet = [this](const httplib::Request &req, httplib::Response &res) {
|
||||
std::string statspath = _homePath + ZT_PATH_SEPARATOR + "metrics.prom";
|
||||
std::string metrics;
|
||||
if (OSUtils::readFile(statspath.c_str(), metrics)) {
|
||||
@@ -2097,9 +2159,11 @@ public:
|
||||
res.set_content("{}", "application/json");
|
||||
res.status = 500;
|
||||
}
|
||||
});
|
||||
};
|
||||
_controlPlane.Get(metricsPath, metricsGet);
|
||||
_controlPlaneV6.Get(metricsPath, metricsGet);
|
||||
|
||||
_controlPlane.set_exception_handler([&, setContent](const httplib::Request &req, httplib::Response &res, std::exception_ptr ep) {
|
||||
auto exceptionHandler = [&, setContent](const httplib::Request &req, httplib::Response &res, std::exception_ptr ep) {
|
||||
char buf[1024];
|
||||
auto fmt = "{\"error\": %d, \"description\": \"%s\"}";
|
||||
try {
|
||||
@@ -2111,39 +2175,70 @@ public:
|
||||
}
|
||||
setContent(req, res, buf);
|
||||
res.status = 500;
|
||||
});
|
||||
};
|
||||
_controlPlane.set_exception_handler(exceptionHandler);
|
||||
_controlPlaneV6.set_exception_handler(exceptionHandler);
|
||||
|
||||
if (_controller) {
|
||||
_controller->configureHTTPControlPlane(_controlPlane, setContent);
|
||||
_controller->configureHTTPControlPlane(_controlPlane, _controlPlaneV6, setContent);
|
||||
}
|
||||
|
||||
_controlPlane.set_pre_routing_handler(authCheck);
|
||||
_controlPlaneV6.set_pre_routing_handler(authCheck);
|
||||
|
||||
#if ZT_DEBUG==1
|
||||
_controlPlane.set_logger([](const httplib::Request &req, const httplib::Response &res) {
|
||||
fprintf(stderr, "%s", http_log(req, res).c_str());
|
||||
});
|
||||
_controlPlaneV6.set_logger([](const httplib::Request &req, const httplib::Response &res) {
|
||||
fprintf(stderr, "%s", http_log(req, res).c_str());
|
||||
});
|
||||
#endif
|
||||
if (_primaryPort==0) {
|
||||
fprintf(stderr, "unable to determine local control port");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if(!_controlPlane.bind_to_port("0.0.0.0", _primaryPort)) {
|
||||
fprintf(stderr, "Error binding control plane to port %d\n", _primaryPort);
|
||||
exit(-1);
|
||||
bool v4controlPlaneBound = false;
|
||||
_controlPlane.set_address_family(AF_INET);
|
||||
if(_controlPlane.bind_to_port("0.0.0.0", _primaryPort)) {
|
||||
_serverThread = std::thread([&] {
|
||||
_serverThreadRunning = true;
|
||||
fprintf(stderr, "Starting Control Plane...\n");
|
||||
if(!_controlPlane.listen_after_bind()) {
|
||||
fprintf(stderr, "Error on listen_after_bind()\n");
|
||||
}
|
||||
fprintf(stderr, "Control Plane Stopped\n");
|
||||
_serverThreadRunning = false;
|
||||
});
|
||||
v4controlPlaneBound = true;
|
||||
} else {
|
||||
fprintf(stderr, "Error binding control plane to 0.0.0.0:%d\n", _primaryPort);
|
||||
v4controlPlaneBound = false;
|
||||
}
|
||||
|
||||
_serverThread = std::thread([&] {
|
||||
_serverThreadRunning = true;
|
||||
fprintf(stderr, "Starting Control Plane...\n");
|
||||
if(!_controlPlane.listen_after_bind()) {
|
||||
fprintf(stderr, "Error on listen_after_bind()\n");
|
||||
}
|
||||
fprintf(stderr, "Control Plane Stopped\n");
|
||||
_serverThreadRunning = false;
|
||||
});
|
||||
bool v6controlPlaneBound = false;
|
||||
_controlPlaneV6.set_address_family(AF_INET6);
|
||||
if(_controlPlaneV6.bind_to_port("::", _primaryPort)) {
|
||||
_serverThreadV6 = std::thread([&] {
|
||||
_serverThreadRunningV6 = true;
|
||||
fprintf(stderr, "Starting V6 Control Plane...\n");
|
||||
if(!_controlPlaneV6.listen_after_bind()) {
|
||||
fprintf(stderr, "Error on V6 listen_after_bind()\n");
|
||||
}
|
||||
fprintf(stderr, "V6 Control Plane Stopped\n");
|
||||
_serverThreadRunningV6 = false;
|
||||
});
|
||||
v6controlPlaneBound = true;
|
||||
} else {
|
||||
fprintf(stderr, "Error binding control plane to [::]:%d\n", _primaryPort);
|
||||
v6controlPlaneBound = false;
|
||||
}
|
||||
|
||||
if (!v4controlPlaneBound && !v6controlPlaneBound) {
|
||||
fprintf(stderr, "ERROR: Could not bind control plane. Exiting...\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
// Must be called after _localConfig is read or modified
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
/**
|
||||
* Revision
|
||||
*/
|
||||
#define ZEROTIER_ONE_VERSION_REVISION 0
|
||||
#define ZEROTIER_ONE_VERSION_REVISION 2
|
||||
|
||||
/**
|
||||
* Build version
|
||||
|
||||
+7
-1
@@ -1,5 +1,5 @@
|
||||
Name: zerotier-one
|
||||
Version: 1.12.0
|
||||
Version: 1.12.2
|
||||
Release: 1%{?dist}
|
||||
Summary: ZeroTier network virtualization service
|
||||
|
||||
@@ -143,6 +143,12 @@ chmod 0755 $RPM_BUILD_ROOT/etc/init.d/zerotier-one
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Tue Sep 12 2023 Adam Ierymenko <adam.ierymenko@zerotier.com> - 1.12.2
|
||||
- see https://github.com/zerotier/ZeroTierOne for release notes
|
||||
|
||||
* Fri Aug 25 2023 Adam Ierymenko <adam.ierymenko@zerotier.com> - 1.12.1
|
||||
- see https://github.com/zerotier/ZeroTierOne for release notes
|
||||
|
||||
* Thu Aug 17 2023 Adam Ierymenko <adam.ierymenko@zerotier.com> - 1.12.0
|
||||
- see https://github.com/zerotier/ZeroTierOne for release notes
|
||||
|
||||
|
||||
Reference in new issue
Block a user