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:
electron128 2015-05-04 09:05:38 +00:00
parent 0f84059fe6
commit a126461beb
2 changed files with 2 additions and 1 deletions

View File

@ -1010,7 +1010,7 @@ bool p3NetMgrIMPL::checkNetAddress()
// 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);
addrChanged = true;

View File

@ -43,6 +43,7 @@
#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_DEFAULT_PORT 7812