From: Steven Barth Date: Tue, 19 Aug 2014 05:37:17 +0000 (+0200) Subject: dhcpv4: fix manual dhcp-ranges X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=710744ecea73b6a3cf560776e298741b04fb727a;p=project%2Fodhcpd.git dhcpv4: fix manual dhcp-ranges --- 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) |