diff --git a/libretroshare/src/pqi/p3netmgr.cc b/libretroshare/src/pqi/p3netmgr.cc index b47c7c6fd..1d75bf52a 100644 --- a/libretroshare/src/pqi/p3netmgr.cc +++ b/libretroshare/src/pqi/p3netmgr.cc @@ -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; diff --git a/libretroshare/src/pqi/pqi_base.h b/libretroshare/src/pqi/pqi_base.h index 68d1805a4..c19542574 100644 --- a/libretroshare/src/pqi/pqi_base.h +++ b/libretroshare/src/pqi/pqi_base.h @@ -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