mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Further optimisation of --port-limit.
No longer try and fail to open every port when the port range is in complete use; go straight to re-using an existing socket. Die at startup if port range is smaller than --port-limit, since the code behaves badly in this case.
This commit is contained in:
@@ -265,6 +265,10 @@ int main (int argc, char **argv)
|
||||
|
||||
if (daemon->max_port < daemon->min_port)
|
||||
die(_("max_port cannot be smaller than min_port"), NULL, EC_BADCONF);
|
||||
|
||||
if (daemon->max_port != 0 &&
|
||||
daemon->max_port - daemon->min_port + 1 < daemon->randport_limit)
|
||||
die(_("port_limit must not be larger than available port range"), NULL, EC_BADCONF);
|
||||
|
||||
now = dnsmasq_time();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user