summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2019-02-01 11:37:30 -0800
committerGrant Limberg <grant.limberg@zerotier.com>2019-02-01 11:38:19 -0800
commit321cada1d73fa35dac5be7e2764dd7c0ff01bab1 (patch)
treeba324cefcccd2dac0b6e4eed60725bbb02938c26
parent2294770e56cc4c6f6a41d18b610afc1abcf94062 (diff)
downloadinfinitytier-321cada1d73fa35dac5be7e2764dd7c0ff01bab1.tar.gz
infinitytier-321cada1d73fa35dac5be7e2764dd7c0ff01bab1.zip
Wrong criteria was wrong. Now with less wrong.
-rw-r--r--controller/EmbeddedNetworkController.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp
index 96dde42f..203dcdd5 100644
--- a/controller/EmbeddedNetworkController.cpp
+++ b/controller/EmbeddedNetworkController.cpp
@@ -1521,12 +1521,9 @@ void EmbeddedNetworkController::_request(
const std::string ips = ipAssignments[i];
InetAddress ip(ips.c_str());
- // IP assignments are only pushed if there is a corresponding local route. We also now get the netmask bits from
- // this route, ignoring the netmask bits field of the assigned IP itself. Using that was worthless and a source
- // of user error / poor UX.
int routedNetmaskBits = -1;
for(unsigned int rk=0;rk<nc->routeCount;++rk) {
- if ( (!nc->routes[rk].via.ss_family) && (reinterpret_cast<const InetAddress *>(&(nc->routes[rk].target))->containsAddress(ip)) )
+ if (reinterpret_cast<const InetAddress *>(&(nc->routes[rk].target))->containsAddress(ip))
routedNetmaskBits = reinterpret_cast<const InetAddress *>(&(nc->routes[rk].target))->netmaskBits();
}