Default min-port to 1024 to avoid reserved ports.

This commit is contained in:
Simon Kelley committed 2018-01-29 23:04:06 +00:00
1 parent 486bcd5a7b
commit baf553db0c
5 files changed
+5 -8

No files matched your search

+1 -4
View File
@@ -1149,10 +1149,7 @@ int random_sock(int family)
if (fix_fd(fd))
while(tries--)
{
unsigned short port = rand16();
if (daemon->min_port != 0 || daemon->max_port != MAX_PORT)
port = htons(daemon->min_port + (port % ((unsigned short)ports_avail)));
unsigned short port = htons(daemon->min_port + (rand16() % ((unsigned short)ports_avail)));
if (family == AF_INET)
{