mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
use random port >=1024 (patch from sehraf)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8217 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0f84059fe6
commit
a126461beb
@ -1010,7 +1010,7 @@ bool p3NetMgrIMPL::checkNetAddress()
|
|||||||
// Random port avoids clashes, improves anonymity.
|
// Random port avoids clashes, improves anonymity.
|
||||||
//
|
//
|
||||||
|
|
||||||
int new_port = htons(PQI_MIN_PORT + (RSRandom::random_u32() % (PQI_MAX_PORT - PQI_MIN_PORT)));
|
int new_port = htons(PQI_MIN_PORT_RNG + (RSRandom::random_u32() % (PQI_MAX_PORT - PQI_MIN_PORT_RNG)));
|
||||||
sockaddr_storage_setport(mLocalAddr, new_port);
|
sockaddr_storage_setport(mLocalAddr, new_port);
|
||||||
|
|
||||||
addrChanged = true;
|
addrChanged = true;
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define PQI_MIN_PORT 10 // TO ALLOW USERS TO HAVE PORT 80! - was 1024
|
#define PQI_MIN_PORT 10 // TO ALLOW USERS TO HAVE PORT 80! - was 1024
|
||||||
|
#define PQI_MIN_PORT_RNG 1024
|
||||||
#define PQI_MAX_PORT 65535
|
#define PQI_MAX_PORT 65535
|
||||||
#define PQI_DEFAULT_PORT 7812
|
#define PQI_DEFAULT_PORT 7812
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user