From: Hans Dedecker Date: Mon, 25 Feb 2019 09:46:18 +0000 (+0100) Subject: dhcpv4: fix static lease lookup X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e69265b4bb20a018193aa107833b147def2e6cfd;p=project%2Fodhcpd.git dhcpv4: fix static lease lookup Function config_find_lease_by_ip_addr expects IP address in network byte order Signed-off-by: Hans Dedecker --- diff --git a/src/dhcpv4.c b/src/dhcpv4.c index ba64142..ff2d8c2 100644 --- a/src/dhcpv4.c +++ b/src/dhcpv4.c @@ -944,7 +944,7 @@ raddr_out: for (uint32_t i = 0, try = (((uint32_t)rand()) % count) + start; i < count; ++i, try = (((try - start) + 1) % count) + start) { - if (config_find_lease_by_ipaddr(try)) + if (config_find_lease_by_ipaddr(htonl(try))) continue; if (list_empty(&iface->dhcpv4_assignments)) {