projects
/
oweals
/
odhcpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b951c5
)
dhcpv4: do not allow pool end address to overlap with broadcast address
author
Dainis Jonitis
<dainis.jonitis@ubnt.com>
Mon, 26 Nov 2018 12:53:51 +0000
(14:53 +0200)
committer
Hans Dedecker
<dedeckeh@gmail.com>
Fri, 3 May 2019 12:51:52 +0000
(14:51 +0200)
Signed-off-by: Dainis Jonitis <dainis.jonitis@ubnt.com>
src/dhcpv4.c
patch
|
blob
|
history
diff --git
a/src/dhcpv4.c
b/src/dhcpv4.c
index 679b7931d2e35e0ceb35c3ece50f1f05ed59dc79..b25046d4ab4f6e5771208059a2281eb2f5883c51 100644
(file)
--- a/
src/dhcpv4.c
+++ b/
src/dhcpv4.c
@@
-239,7
+239,8
@@
static int setup_dhcpv4_addresses(struct interface *iface)
odhcpd_bitlen2netmask(false, iface->addr4[i].prefix, &mask);
if ((start & ntohl(~mask.s_addr)) == start &&
- (end & ntohl(~mask.s_addr)) == end) {
+ (end & ntohl(~mask.s_addr)) == end &&
+ end < ntohl(~mask.s_addr)) { /* Exclude broadcast address */
iface->dhcpv4_start_ip.s_addr = htonl(start) |
(addr->s_addr & mask.s_addr);
iface->dhcpv4_end_ip.s_addr = htonl(end) |