mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-29 15:43:52 +00:00
Take netmask bits from most specific route.
This commit is contained in:
parent
34c1023ba7
commit
5b1ef2fb03
@ -1523,8 +1523,11 @@ void EmbeddedNetworkController::_request(
|
||||
|
||||
int routedNetmaskBits = -1;
|
||||
for(unsigned int rk=0;rk<nc->routeCount;++rk) {
|
||||
if (reinterpret_cast<const InetAddress *>(&(nc->routes[rk].target))->containsAddress(ip))
|
||||
routedNetmaskBits = reinterpret_cast<const InetAddress *>(&(nc->routes[rk].target))->netmaskBits();
|
||||
if (reinterpret_cast<const InetAddress *>(&(nc->routes[rk].target))->containsAddress(ip)) {
|
||||
const int nb = (int)(reinterpret_cast<const InetAddress *>(&(nc->routes[rk].target))->netmaskBits());
|
||||
if (nb > routedNetmaskBits)
|
||||
routedNetmaskBits = nb;
|
||||
}
|
||||
}
|
||||
|
||||
if (routedNetmaskBits >= 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user