Added 10.0.0.0 private network scheme

This commit is contained in:
renaud gaudin 2014-05-31 13:53:46 +00:00
parent a37fd98585
commit 1b192c2557
1 changed files with 14 additions and 7 deletions

View File

@ -117,7 +117,14 @@ std::string kiwix::getBestPublicIp() {
for(std::map<std::string, std::string>::iterator iter = interfaces.begin();
iter != interfaces.end(); ++iter) {
std::string interfaceIp = iter->second;
if (interfaceIp.length() >= 3 && interfaceIp.substr(0, 3) == "172")
if (interfaceIp.length() >= 7 && interfaceIp.substr(0, 7) == "172.16.")
return interfaceIp;
}
for(std::map<std::string, std::string>::iterator iter = interfaces.begin();
iter != interfaces.end(); ++iter) {
std::string interfaceIp = iter->second;
if (interfaceIp.length() >= 3 && interfaceIp.substr(0, 3) == "10.")
return interfaceIp;
}