Rename getBestRoot() etc.

This commit is contained in:
Adam Ierymenko 2016-11-17 16:31:58 -08:00
parent bf8d71e82c
commit 1615ef1114
6 changed files with 9 additions and 34 deletions

View file

@ -211,8 +211,7 @@ public:
}
if (upstream) {
// "Upstream" devices are roots and relays and get special treatment -- they stay alive
// forever and we try to keep (if available) both IPv4 and IPv6 channels open to them.
// We keep connections to upstream peers alive forever.
bool needToContactIndirect = true;
if (p->doPingAndKeepalive(_now,AF_INET)) {
needToContactIndirect = false;
@ -231,11 +230,8 @@ public:
}
}
// If we don't have a direct path or a static endpoint, send something indirectly to find one.
if (needToContactIndirect) {
// If this is an upstream and we have no stable endpoint for either IPv4 or IPv6,
// send a NOP indirectly if possible to see if we can get to this peer in any
// way whatsoever. This will e.g. find network preferred relays that lack
// stable endpoints by using root servers.
Packet outp(p->address(),RR->identity.address(),Packet::VERB_NOP);
RR->sw->send(outp,true);
}