summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/dhcpv4.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dhcpv4.c b/src/dhcpv4.c
index 679b793..b25046d 100644
--- 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) |