summaryrefslogtreecommitdiff
path: root/src/dnsmasq.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dnsmasq.c')
-rw-r--r--src/dnsmasq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
index 4742a97..bd3dcf5 100644
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -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();