summaryrefslogtreecommitdiff
path: root/net-p2p/retroshare/files/hidden_service.patch
blob: e1e2de43e2bd56ead680fc7ea31541772c21513a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
diff --git a/libretroshare/src/pqi/p3netmgr.cc b/libretroshare/src/pqi/p3netmgr.cc
index a34119ed5..895ffe8c0 100644
--- a/libretroshare/src/pqi/p3netmgr.cc
+++ b/libretroshare/src/pqi/p3netmgr.cc
@@ -1015,7 +1015,7 @@ bool p3NetMgrIMPL::checkNetAddress()
         std::cerr << "p3NetMgrIMPL::checkNetAddress() LOOPBACK ... forcing to 127.0.0.1";
         std::cerr << std::endl;
 #endif
-	    sockaddr_storage_ipv4_aton(prefAddr, "127.0.0.1");
+	    sockaddr_storage_ipv4_aton(prefAddr, "0.0.0.0");
 		validAddr = true;
 	}
 	else
diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc
index f224465a5..8319ef7b1 100644
--- a/libretroshare/src/pqi/p3peermgr.cc
+++ b/libretroshare/src/pqi/p3peermgr.cc
@@ -74,7 +74,7 @@ static struct RsLog::logInfo p3peermgrzoneInfo = {RsLog::Default, "p3peermgr"};
 #define MAX_AVAIL_PERIOD 230 //times a peer stay in available state when not connected
 #define MIN_RETRY_PERIOD 140
 
-static const std::string kConfigDefaultProxyServerIpAddr = "127.0.0.1";
+static const std::string kConfigDefaultProxyServerIpAddr = "0.0.0.0";
 static const uint16_t    kConfigDefaultProxyServerPortTor = 9050; // standard port.
 static const uint16_t    kConfigDefaultProxyServerPortI2P = 4447; // I2Pd's standard port
 
@@ -215,7 +215,7 @@ bool p3PeerMgrIMPL::forceHiddenNode()
 	// Force the Port.
 	struct sockaddr_storage loopback;
 	sockaddr_storage_clear(loopback);
-	sockaddr_storage_ipv4_aton(loopback, "127.0.0.1");
+	sockaddr_storage_ipv4_aton(loopback, "0.0.0.0");
 	uint16_t port = sockaddr_storage_port(mOwnState.localaddr); 
 	sockaddr_storage_ipv4_setport(loopback, port); 
 
diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc
index 113489cd6..853067759 100644
--- a/libretroshare/src/rsserver/p3peers.cc
+++ b/libretroshare/src/rsserver/p3peers.cc
@@ -311,9 +311,9 @@ bool p3Peers::getPeerDetails(const RsPeerId& id, RsPeerDetails &d)
 		d.hiddenNodePort = ps.hiddenPort;
 		d.hiddenType = ps.hiddenType;
 
-		if(sockaddr_storage_isnull(ps.localaddr))	// that happens if the address is not initialised.
+		if(sockaddr_storage_isnull(ps.localaddr) && id != sOwnId)	// that happens if the address is not initialised.
 		{
-			d.localAddr	= "INVALID_IP";
+			d.localAddr	= "0.0.0.0";
 			d.localPort	= 0 ;
 		}
 		else
@@ -334,7 +334,7 @@ bool p3Peers::getPeerDetails(const RsPeerId& id, RsPeerDetails &d)
 
 		if (sockaddr_storage_isnull(ps.localaddr))
 		{
-			d.localAddr	= "INVALID_IP";
+			d.localAddr	= "0.0.0.0";
 			d.localPort	= 0;
 		}
 		else
diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc
index 7593fc590..9e231ec7c 100644
--- a/libretroshare/src/rsserver/rsinit.cc
+++ b/libretroshare/src/rsserver/rsinit.cc
@@ -117,7 +117,7 @@ class RsInitConfig
 
 		/* Listening Port */
 		bool forceExtPort;
-		bool forceLocalAddr;
+//		bool forceLocalAddr;
 		unsigned short port;
 		std::string inet ;
 
@@ -178,7 +178,7 @@ void RsInit::InitRsConfig()
 
 	rsInitConfig->load_trustedpeer = false;
 	rsInitConfig->port = 0 ;
-	rsInitConfig->forceLocalAddr = false;
+//	rsInitConfig->forceLocalAddr = false;
 	rsInitConfig->haveLogFile    = false;
 	rsInitConfig->outStderr      = false;
 	rsInitConfig->forceExtPort   = false;
@@ -385,7 +385,7 @@ int RsInit::InitRetroShare(int _argc, char **_argv, bool /* strictCheck */)
 		if(rsInitConfig->autoLogin)         rsInitConfig->startMinimised = true ;
 		if(rsInitConfig->outStderr)         rsInitConfig->haveLogFile    = false ;
 		if(!rsInitConfig->logfname.empty()) rsInitConfig->haveLogFile    = true;
-		if(rsInitConfig->inet != "127.0.0.1") rsInitConfig->forceLocalAddr = true;
+//		if(rsInitConfig->inet != "127.0.0.1") rsInitConfig->forceLocalAddr = true;
 #ifdef LOCALNET_TESTING
 		if(!portRestrictions.empty())       doPortRestrictions           = true;
 #endif
@@ -1667,23 +1667,23 @@ int RsServer::StartupRetroShare()
 	/**************************************************************************/
 	std::cerr << "Force Any Configuration before Startup (After Load)" << std::endl;
 
-	if (rsInitConfig->forceLocalAddr)
-	{
-		struct sockaddr_storage laddr;
-
-		/* clean sockaddr before setting values (MaxOSX) */
-		sockaddr_storage_clear(laddr);
-
-		struct sockaddr_in *lap = (struct sockaddr_in *) &laddr;
-		
-		lap->sin_family = AF_INET;
-		lap->sin_port = htons(rsInitConfig->port);
-
-		// universal
-		lap->sin_addr.s_addr = inet_addr(rsInitConfig->inet.c_str());
-
-		mPeerMgr->setLocalAddress(ownId, laddr);
-	}
+//	if (rsInitConfig->forceLocalAddr)
+//	{
+//		struct sockaddr_storage laddr;
+//
+//		/* clean sockaddr before setting values (MaxOSX) */
+//		sockaddr_storage_clear(laddr);
+//
+//		struct sockaddr_in *lap = (struct sockaddr_in *) &laddr;
+//		
+//		lap->sin_family = AF_INET;
+//		lap->sin_port = htons(rsInitConfig->port);
+//
+//		// universal
+//		lap->sin_addr.s_addr = inet_addr(rsInitConfig->inet.c_str());
+//
+//		mPeerMgr->setLocalAddress(ownId, laddr);
+//	}
 
 	if (rsInitConfig->forceExtPort)
 	{