summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2019-02-25 10:46:18 +0100
committerHans Dedecker <dedeckeh@gmail.com>2019-02-25 10:48:25 +0100
commite69265b4bb20a018193aa107833b147def2e6cfd (patch)
treeb8a6f78ece844102912b6e340b6cd743f7d85fe3 /src
parentafbd7dd2a0f26f603ee21685ede2bba14a41a34a (diff)
dhcpv4: fix static lease lookup
Function config_find_lease_by_ip_addr expects IP address in network byte order Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/dhcpv4.c2
1 files changed, 1 insertions, 1 deletions
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)) {