From 57a2f5778c7771bb273dded46975cb57713b8429 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Fri, 28 Nov 2025 15:14:09 +0000 Subject: [PATCH] Fix confusion in address checking code. This was supposed to disallow addresses which are in use by the DHCP server, and the code works fine when only dhcp-range is defined per broadcast domain. It's confused when there are multiple dhcp-ranges which are valid for a particular request. --- src/dhcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcp.c b/src/dhcp.c index d89734f..6775fb6 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -696,7 +696,7 @@ struct dhcp_context *address_available(struct dhcp_context *context, struct dhcp_context *tmp; for (tmp = context; tmp; tmp = tmp->current) - if (taddr.s_addr == context->router.s_addr) + if (taddr.s_addr == tmp->router.s_addr) return NULL; for (tmp = context; tmp; tmp = tmp->current)