From 710744ecea73b6a3cf560776e298741b04fb727a Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 19 Aug 2014 07:37:17 +0200 Subject: [PATCH] dhcpv4: fix manual dhcp-ranges --- src/dhcpv4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dhcpv4.c b/src/dhcpv4.c index 92a1397..89750b2 100644 --- a/src/dhcpv4.c +++ b/src/dhcpv4.c @@ -137,8 +137,8 @@ int setup_dhcpv4_interface(struct interface *iface, bool enable) if (start && end && start < end && start > ntohl(addr.s_addr & ~mask.s_addr) && - (start & ntohl(mask.s_addr)) == start && - (end & ntohl(mask.s_addr)) == end) { + (start & ntohl(~mask.s_addr)) == start && + (end & ntohl(~mask.s_addr)) == end) { iface->dhcpv4_start.s_addr = htonl(start) | (addr.s_addr & mask.s_addr); iface->dhcpv4_end.s_addr = htonl(end) | -- 2.25.1