mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-22 06:17:48 +00:00
Never assign v4 IPs ending in .255 even within range.
This commit is contained in:
parent
2d0adb562d
commit
a7bd1eaa40
@ -1742,6 +1742,8 @@ NetworkController::ResultCode SqliteNetworkController::_doNetworkConfigRequest(c
|
||||
for(uint32_t k=ipRangeStart,l=0;(k<=ipRangeEnd)&&(l < 1000000);++k,++l) {
|
||||
uint32_t ip = (ipRangeLen > 0) ? (ipRangeStart + (ipTrialCounter % ipRangeLen)) : ipRangeStart;
|
||||
++ipTrialCounter;
|
||||
if ((ip & 0x000000ff) == 0x000000ff)
|
||||
continue; // don't allow addresses that end in .255
|
||||
|
||||
for(std::vector< std::pair<uint32_t,int> >::const_iterator r(routedNetworks.begin());r!=routedNetworks.end();++r) {
|
||||
if ((ip & (0xffffffff << (32 - r->second))) == r->first) {
|
||||
|
Loading…
Reference in New Issue
Block a user