Fix for cluster handoff.

This commit is contained in:
Adam Ierymenko 2017-04-14 18:02:04 -07:00
parent 139c4b5633
commit f1c0563c40
3 changed files with 22 additions and 2 deletions

View file

@ -169,7 +169,7 @@ void Peer::received(
if (verb == Packet::VERB_OK) {
Mutex::Lock _l(_paths_m);
if (path->address().ss_family == AF_INET) {
if ((!_v4Path.p)||(!_v4Path.p->alive(now))||(path->preferenceRank() >= _v4Path.p->preferenceRank())) {
if ( (!_v4Path.p) || (!_v4Path.p->alive(now)) || ((_v4Path.p->address() != _v4ClusterPreferred)&&(path->preferenceRank() >= _v4Path.p->preferenceRank())) ) {
_v4Path.lr = now;
_v4Path.p = path;
#ifdef ZT_ENABLE_CLUSTER
@ -179,7 +179,7 @@ void Peer::received(
#endif
}
} else if (path->address().ss_family == AF_INET6) {
if ((!_v6Path.p)||(!_v6Path.p->alive(now))||(path->preferenceRank() >= _v6Path.p->preferenceRank())) {
if ( (!_v6Path.p) || (!_v6Path.p->alive(now)) || ((_v6Path.p->address() != _v6ClusterPreferred)&&(path->preferenceRank() >= _v6Path.p->preferenceRank())) ) {
_v6Path.lr = now;
_v6Path.p = path;
#ifdef ZT_ENABLE_CLUSTER