mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-21 10:01:46 +00:00
Build fix on Linux with G++.
This commit is contained in:
parent
0ad84b8723
commit
9acfd3eb73
@ -251,7 +251,7 @@ EthernetTap::EthernetTap(
|
|||||||
bool recalledDevice = false;
|
bool recalledDevice = false;
|
||||||
if ((tag)&&(tag[0])) {
|
if ((tag)&&(tag[0])) {
|
||||||
Utils::scopy(ifr.ifr_name,sizeof(ifr.ifr_name),tag);
|
Utils::scopy(ifr.ifr_name,sizeof(ifr.ifr_name),tag);
|
||||||
Utils::snprintf(procpath,sizeof(procpath),"/proc/sys/net/ipv4/conf/%s",ifr.fr_name);
|
Utils::snprintf(procpath,sizeof(procpath),"/proc/sys/net/ipv4/conf/%s",ifr.ifr_name);
|
||||||
recalledDevice = (stat(procpath,&sbuf) != 0);
|
recalledDevice = (stat(procpath,&sbuf) != 0);
|
||||||
}
|
}
|
||||||
if (!recalledDevice) {
|
if (!recalledDevice) {
|
||||||
|
@ -134,8 +134,9 @@ void Topology::saveIdentity(const Identity &id)
|
|||||||
SharedPtr<Peer> Topology::getBestSupernode(const Address *avoid,unsigned int avoidCount,bool strictAvoid) const
|
SharedPtr<Peer> Topology::getBestSupernode(const Address *avoid,unsigned int avoidCount,bool strictAvoid) const
|
||||||
{
|
{
|
||||||
SharedPtr<Peer> bestSupernode;
|
SharedPtr<Peer> bestSupernode;
|
||||||
unsigned int bestSupernodeLatency = 65536;
|
unsigned int l,bestSupernodeLatency = 65536;
|
||||||
uint64_t now = Utils::now();
|
uint64_t now = Utils::now();
|
||||||
|
uint64_t lds,ldr;
|
||||||
|
|
||||||
Mutex::Lock _l(_supernodes_m);
|
Mutex::Lock _l(_supernodes_m);
|
||||||
|
|
||||||
@ -150,13 +151,13 @@ SharedPtr<Peer> Topology::getBestSupernode(const Address *avoid,unsigned int avo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Skip possibly comatose or unreachable relays
|
// Skip possibly comatose or unreachable relays
|
||||||
uint64_t lds = (*sn)->lastDirectSend();
|
lds = (*sn)->lastDirectSend();
|
||||||
uint64_t ldr = (*sn)->lastDirectReceive();
|
ldr = (*sn)->lastDirectReceive();
|
||||||
if ((lds)&&(lds > ldr)&&((lds - ldr) > ZT_PEER_RELAY_CONVERSATION_LATENCY_THRESHOLD))
|
if ((lds)&&(lds > ldr)&&((lds - ldr) > ZT_PEER_RELAY_CONVERSATION_LATENCY_THRESHOLD))
|
||||||
goto keep_searching_for_supernodes;
|
goto keep_searching_for_supernodes;
|
||||||
|
|
||||||
if ((*sn)->hasActiveDirectPath(now)) {
|
if ((*sn)->hasActiveDirectPath(now)) {
|
||||||
unsigned int l = (*sn)->latency();
|
l = (*sn)->latency();
|
||||||
if (bestSupernode) {
|
if (bestSupernode) {
|
||||||
if ((l)&&(l < bestSupernodeLatency)) {
|
if ((l)&&(l < bestSupernodeLatency)) {
|
||||||
bestSupernodeLatency = l;
|
bestSupernodeLatency = l;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user