Added allowTcpFallbackRelay to local.conf, fixed logic in Binder's route enumeration

This commit is contained in:
Joseph Henry 2018-01-10 12:41:52 -08:00
parent 7e2d614975
commit 640cc22749
2 changed files with 64 additions and 49 deletions

View file

@ -137,6 +137,7 @@ public:
std::map<InetAddress,std::string> localIfAddrs;
PhySocket *udps,*tcps;
Mutex::Lock _l(_lock);
bool interfacesEnumerated = true;
#ifdef __WINDOWS__
@ -167,6 +168,9 @@ public:
a = a->Next;
}
}
else {
interfacesEnumerated = false;
}
#else // not __WINDOWS__
@ -195,6 +199,9 @@ public:
}
fclose(procf);
}
else {
interfacesEnumerated = false;
}
// Get IPv6 addresses (and any device names we don't already know)
OSUtils::ztsnprintf(fn,sizeof(fn),"/proc/%lu/net/if_inet6",pid);
@ -314,12 +321,15 @@ public:
}
freeifaddrs(ifatbl);
}
else {
interfacesEnumerated = false;
}
}
#endif
// Default to binding to wildcard if we can't enumerate addresses
if (localIfAddrs.empty()) {
if (!interfacesEnumerated && localIfAddrs.empty()) {
for(int x=0;x<(int)portCount;++x) {
localIfAddrs.insert(std::pair<InetAddress,std::string>(InetAddress((uint32_t)0,ports[x]),std::string()));
localIfAddrs.insert(std::pair<InetAddress,std::string>(InetAddress((const void *)"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",16,ports[x]),std::string()));