From 3b1d1d35fe456e57f1faae8295cddc6b00b16dea Mon Sep 17 00:00:00 2001 From: joss17 Date: Tue, 27 Apr 2010 21:59:59 +0000 Subject: [PATCH] add a loopback test git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2806 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/p3connmgr.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/pqi/p3connmgr.cc b/libretroshare/src/pqi/p3connmgr.cc index ea3c66f4d..029048172 100644 --- a/libretroshare/src/pqi/p3connmgr.cc +++ b/libretroshare/src/pqi/p3connmgr.cc @@ -61,7 +61,7 @@ const uint32_t MAX_NETWORK_INIT = 70; /* timeout before network reset */ const uint32_t MIN_TIME_BETWEEN_NET_RESET = 5; -const uint32_t PEER_IP_CONNECT_STATE_MAX_LIST_SIZE = 6; +const uint32_t PEER_IP_CONNECT_STATE_MAX_LIST_SIZE = 4; /**** * #define CONN_DEBUG 1 @@ -3581,9 +3581,9 @@ void peerConnectState::updateIpAddressList(IpAddressTimed ipTimed) { //purge old #endif if (ipTimed.ipAddr.sin_addr.s_addr == 0 || ipTimed.ipAddr.sin_port == 0 || ipTimed.ipAddr.sin_addr.s_addr == 1|| ipTimed.ipAddr.sin_port == 1 || - std::string(inet_ntoa(ipTimed.ipAddr.sin_addr)) == "1.1.1.1") { + std::string(inet_ntoa(ipTimed.ipAddr.sin_addr)) == "1.1.1.1" || isLoopbackNet(&ipTimed.ipAddr.sin_addr)) { #ifdef CONN_DEBUG - std::cerr << "peerConnectState::updateIpAdressList() ip parameter is 0.0.0.0, 1.1.1.1 or port is 0, ignoring." << std::endl; + std::cerr << "peerConnectState::updateIpAdressList() ip parameter is 0.0.0.0, 1.1.1.1, or loopback, or port is 0, ignoring." << std::endl; #endif return; }