mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Don't bind to temporary Ipv6 addresses (windows)
This commit is contained in:
parent
810e2a761f
commit
198e6f765c
1 changed files with 19 additions and 15 deletions
|
@ -135,12 +135,15 @@ public:
|
||||||
while (a) {
|
while (a) {
|
||||||
PIP_ADAPTER_UNICAST_ADDRESS ua = a->FirstUnicastAddress;
|
PIP_ADAPTER_UNICAST_ADDRESS ua = a->FirstUnicastAddress;
|
||||||
while (ua) {
|
while (ua) {
|
||||||
|
// Don't bind temporary/random IPv6 addresses
|
||||||
|
if (ua->SuffixOrigin != IpSuffixOriginRandom) {
|
||||||
InetAddress ip(ua->Address.lpSockaddr);
|
InetAddress ip(ua->Address.lpSockaddr);
|
||||||
char strBuf[128] = { 0 };
|
char strBuf[128] = { 0 };
|
||||||
wcstombs(strBuf, a->FriendlyName, sizeof(strBuf));
|
wcstombs(strBuf, a->FriendlyName, sizeof(strBuf));
|
||||||
if (ifChecker.shouldBindInterface(strBuf, ip)) {
|
if (ifChecker.shouldBindInterface(strBuf, ip)) {
|
||||||
switch (ip.ipScope()) {
|
switch (ip.ipScope()) {
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
case InetAddress::IP_SCOPE_PSEUDOPRIVATE:
|
case InetAddress::IP_SCOPE_PSEUDOPRIVATE:
|
||||||
case InetAddress::IP_SCOPE_GLOBAL:
|
case InetAddress::IP_SCOPE_GLOBAL:
|
||||||
case InetAddress::IP_SCOPE_SHARED:
|
case InetAddress::IP_SCOPE_SHARED:
|
||||||
|
@ -152,6 +155,7 @@ public:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ua = ua->Next;
|
ua = ua->Next;
|
||||||
}
|
}
|
||||||
a = a->Next;
|
a = a->Next;
|
||||||
|
|
Loading…
Add table
Reference in a new issue