mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-10-27 12:31:03 +00:00
Default min-port to 1024 to avoid reserved ports.
This commit is contained in:
1 parent
486bcd5a7b
commit
baf553db0c
5 files changed
+5
-8
No files matched your search
+1
-4
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user