Fix a bug that could cause duplicate IP address assignment on networks if many new members join the controller at once.

This commit is contained in:
Adam Ierymenko 2017-03-06 16:21:49 -08:00
parent 5e6a4e5f5e
commit 7ea7e1898a
2 changed files with 8 additions and 1 deletions

View file

@ -664,6 +664,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
// Member is being de-authorized, so spray Revocation objects to all online members
if (!newAuth) {
_clearNetworkMemberInfoCache(nwid);
Revocation rev(_node->prng(),nwid,0,now,ZT_REVOCATION_FLAG_FAST_PROPAGATE,Address(address),Revocation::CREDENTIAL_TYPE_COM);
rev.sign(_signingId);
Mutex::Lock _l(_lastRequestTime_m);
@ -1662,6 +1663,7 @@ void EmbeddedNetworkController::_request(
if (nc.staticIpCount < ZT_MAX_ZT_ASSIGNED_ADDRESSES)
nc.staticIps[nc.staticIpCount++] = ip6;
haveManagedIpv6AutoAssignment = true;
_clearNetworkMemberInfoCache(nwid); // clear cache to prevent IP assignment duplication on many rapid assigns
break;
}
}
@ -1717,6 +1719,7 @@ void EmbeddedNetworkController::_request(
v4ip->sin_addr.s_addr = Utils::hton(ip);
}
haveManagedIpv4AutoAssignment = true;
_clearNetworkMemberInfoCache(nwid); // clear cache to prevent IP assignment duplication on many rapid assigns
break;
}
}