diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-02-11 23:09:53 +0000 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-02-11 23:09:53 +0000 |
commit | 9acfd3eb734bc745d42e9e6acff950891ce831d3 (patch) | |
tree | 202294c1573b6f500365c6c9d8ddc97696b01216 | |
parent | 0ad84b872331ec344ab35c240c97ccf4870f3896 (diff) | |
download | infinitytier-9acfd3eb734bc745d42e9e6acff950891ce831d3.tar.gz infinitytier-9acfd3eb734bc745d42e9e6acff950891ce831d3.zip |
Build fix on Linux with G++.
-rw-r--r-- | node/EthernetTap.cpp | 2 | ||||
-rw-r--r-- | node/Topology.cpp | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/node/EthernetTap.cpp b/node/EthernetTap.cpp index d2302e3f..bcb6a876 100644 --- a/node/EthernetTap.cpp +++ b/node/EthernetTap.cpp @@ -251,7 +251,7 @@ EthernetTap::EthernetTap( bool recalledDevice = false; if ((tag)&&(tag[0])) { 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); } if (!recalledDevice) { diff --git a/node/Topology.cpp b/node/Topology.cpp index 0d12d095..d29055dd 100644 --- a/node/Topology.cpp +++ b/node/Topology.cpp @@ -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> bestSupernode; - unsigned int bestSupernodeLatency = 65536; + unsigned int l,bestSupernodeLatency = 65536; uint64_t now = Utils::now(); + uint64_t lds,ldr; 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 - uint64_t lds = (*sn)->lastDirectSend(); - uint64_t ldr = (*sn)->lastDirectReceive(); + lds = (*sn)->lastDirectSend(); + ldr = (*sn)->lastDirectReceive(); if ((lds)&&(lds > ldr)&&((lds - ldr) > ZT_PEER_RELAY_CONVERSATION_LATENCY_THRESHOLD)) goto keep_searching_for_supernodes; if ((*sn)->hasActiveDirectPath(now)) { - unsigned int l = (*sn)->latency(); + l = (*sn)->latency(); if (bestSupernode) { if ((l)&&(l < bestSupernodeLatency)) { bestSupernodeLatency = l; |