mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 06:02:41 -04:00
This is a little experimental modification to the TCP/UDP listening ports.
* Modified bind calls to attach to 0.0.0.0:XXXX instead of specific IP:Port combinations. This will help connectivity when RS chooses the wrong interface. * These changes are within #defines so they can be easily reverted. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1498 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c14572b13e
commit
6e5d2f43d8
2 changed files with 32 additions and 0 deletions
|
@ -39,6 +39,13 @@
|
||||||
|
|
||||||
const int pqissllistenzone = 49787;
|
const int pqissllistenzone = 49787;
|
||||||
|
|
||||||
|
/* NB: This #define makes the listener open 0.0.0.0:X port instead
|
||||||
|
* of a specific port - this might help retroshare work on PCs with
|
||||||
|
* multiple interfaces or unique network setups.
|
||||||
|
* #define OPEN_UNIVERSAL_PORT 1
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define OPEN_UNIVERSAL_PORT 1
|
||||||
|
|
||||||
/************************ PQI SSL LISTEN BASE ****************************
|
/************************ PQI SSL LISTEN BASE ****************************
|
||||||
*
|
*
|
||||||
|
@ -200,7 +207,13 @@ int pqissllistenbase::setuplisten()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OPEN_UNIVERSAL_PORT
|
||||||
|
struct sockaddr_in tmpaddr = laddr;
|
||||||
|
tmpaddr.sin_addr.s_addr = 0;
|
||||||
|
if (0 != (err = bind(lsock, (struct sockaddr *) &tmpaddr, sizeof(tmpaddr))))
|
||||||
|
#else
|
||||||
if (0 != (err = bind(lsock, (struct sockaddr *) &laddr, sizeof(laddr))))
|
if (0 != (err = bind(lsock, (struct sockaddr *) &laddr, sizeof(laddr))))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
out << "pqissllistenbase::setuplisten()";
|
out << "pqissllistenbase::setuplisten()";
|
||||||
|
|
|
@ -52,6 +52,17 @@
|
||||||
|
|
||||||
static const int UDP_DEF_TTL = 64;
|
static const int UDP_DEF_TTL = 64;
|
||||||
|
|
||||||
|
/* NB: This #define makes the listener open 0.0.0.0:X port instead
|
||||||
|
* of a specific port - this might help retroshare work on PCs with
|
||||||
|
* multiple interfaces or unique network setups.
|
||||||
|
* #define OPEN_UNIVERSAL_PORT 1
|
||||||
|
*
|
||||||
|
* This is also defined in pqissllistener (for TCP port).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define OPEN_UNIVERSAL_PORT 1
|
||||||
|
|
||||||
|
|
||||||
class udpPacket
|
class udpPacket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -319,7 +330,15 @@ int UdpLayer::openSocket()
|
||||||
std::cerr << "UpdStreamer::openSocket()" << std::endl;
|
std::cerr << "UpdStreamer::openSocket()" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
/* bind to address */
|
/* bind to address */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef OPEN_UNIVERSAL_PORT
|
||||||
|
struct sockaddr_in tmpaddr = laddr;
|
||||||
|
tmpaddr.sin_addr.s_addr = 0;
|
||||||
|
if (0 != tounet_bind(sockfd, (struct sockaddr *) (&tmpaddr), sizeof(tmpaddr)))
|
||||||
|
#else
|
||||||
if (0 != tounet_bind(sockfd, (struct sockaddr *) (&laddr), sizeof(laddr)))
|
if (0 != tounet_bind(sockfd, (struct sockaddr *) (&laddr), sizeof(laddr)))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_UDP_LAYER
|
#ifdef DEBUG_UDP_LAYER
|
||||||
std::cerr << "Socket Failed to Bind to : " << laddr << std::endl;
|
std::cerr << "Socket Failed to Bind to : " << laddr << std::endl;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue