From e69265b4bb20a018193aa107833b147def2e6cfd Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 25 Feb 2019 10:46:18 +0100 Subject: [PATCH] dhcpv4: fix static lease lookup Function config_find_lease_by_ip_addr expects IP address in network byte order Signed-off-by: Hans Dedecker --- src/dhcpv4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) { -- 2.25.1