diff --git a/libretroshare/src/pqi/p3netmgr.cc b/libretroshare/src/pqi/p3netmgr.cc index c923f2d75..e6b6b4cff 100644 --- a/libretroshare/src/pqi/p3netmgr.cc +++ b/libretroshare/src/pqi/p3netmgr.cc @@ -1021,7 +1021,7 @@ bool p3NetMgrIMPL::checkNetAddress() std::list::iterator it; if (getLocalAddresses(addrs)) for(it = addrs.begin(); (it != addrs.end() && !validAddr); ++it) - if(sockaddr_storage_isValidNet(*it)) + if(sockaddr_storage_isValidNet(*it) && !sockaddr_storage_isLoopbackNet(*it)) { prefAddr = *it; validAddr = true; diff --git a/libretroshare/src/pqi/pqinetwork.cc b/libretroshare/src/pqi/pqinetwork.cc index a4203c509..6b589cf44 100644 --- a/libretroshare/src/pqi/pqinetwork.cc +++ b/libretroshare/src/pqi/pqinetwork.cc @@ -303,8 +303,6 @@ bool getLocalAddresses(std::list & addrs) IP_ADAPTER_ADDRESSES* adapter(NULL); for(adapter = adapter_addresses; NULL != adapter; adapter = adapter->Next) { - if (adapter->IfType == IF_TYPE_SOFTWARE_LOOPBACK) continue; - IP_ADAPTER_UNICAST_ADDRESS* address; for ( address = adapter->FirstUnicastAddress; address; address = address->Next) { @@ -320,7 +318,7 @@ bool getLocalAddresses(std::list & addrs) struct ifaddrs *ifsaddrs, *ifa; if(getifaddrs(&ifsaddrs) != 0) getLocalAddressesFailed(); for ( ifa = ifsaddrs; ifa; ifa = ifa->ifa_next ) - if ( (ifa->ifa_flags & IFF_UP) && !(ifa->ifa_flags & IFF_LOOPBACK) ) + if ( ifa->ifa_addr && (ifa->ifa_flags & IFF_UP) ) { sockaddr_storage * tmp = new sockaddr_storage; sockaddr_storage_clear(*tmp);