From 640cc22749276e7c7f6e7cfa4eee8c0590064ac0 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Wed, 10 Jan 2018 12:41:52 -0800 Subject: Added allowTcpFallbackRelay to local.conf, fixed logic in Binder's route enumeration --- osdep/Binder.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'osdep') 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 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((uint32_t)0,ports[x]),std::string())); localIfAddrs.insert(std::pair(InetAddress((const void *)"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",16,ports[x]),std::string())); -- cgit v1.2.3