summaryrefslogtreecommitdiff
path: root/osdep
diff options
context:
space:
mode:
authorJoseph Henry <josephjah@gmail.com>2018-01-10 12:41:52 -0800
committerJoseph Henry <josephjah@gmail.com>2018-01-10 12:41:52 -0800
commit640cc22749276e7c7f6e7cfa4eee8c0590064ac0 (patch)
tree9e9a7698641f3154eba8993ffe15a589e82af5b8 /osdep
parent7e2d6149759e84ab4dc4a4f2e025d143b2882900 (diff)
downloadinfinitytier-640cc22749276e7c7f6e7cfa4eee8c0590064ac0.tar.gz
infinitytier-640cc22749276e7c7f6e7cfa4eee8c0590064ac0.zip
Added allowTcpFallbackRelay to local.conf, fixed logic in Binder's route enumeration
Diffstat (limited to 'osdep')
-rw-r--r--osdep/Binder.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/osdep/Binder.hpp b/osdep/Binder.hpp
index 2c42daee..e10c0080 100644
--- a/osdep/Binder.hpp
+++ b/osdep/Binder.hpp
@@ -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()));