projects
/
dnsmasq.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5487f69
)
Avoid division by zero with unlucky choices of max-port and min-port.
author
Simon Kelley
<simon@thekelleys.org.uk>
Thu, 20 Feb 2025 23:43:10 +0000
(23:43 +0000)
committer
Simon Kelley
<simon@thekelleys.org.uk>
Fri, 14 Mar 2025 15:12:45 +0000
(15:12 +0000)
src/network.c
patch
|
blob
|
history
diff --git
a/src/network.c
b/src/network.c
index
1c71fe3
..
61742f6
100644
(file)
--- a/
src/network.c
+++ b/
src/network.c
@@
-1379,7
+1379,7
@@
int local_bind(int fd, union mysockaddr *addr, char *intname, unsigned int ifind
/* cannot set source _port_ for TCP connections. */
if (is_tcp)
port = 0;
- else if (port == 0 && daemon->max_port != 0)
+ else if (port == 0 && daemon->max_port != 0
&& daemon->max_port >= daemon->min_port
)
{
/* Bind a random port within the range given by min-port and max-port if either
or both are set. Otherwise use the OS's random ephemeral port allocation by