ell.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] dhcp-server: Fix debug messages in send_offer
@ 2021-07-09 11:47 Andrew Zaborowski
  2021-07-09 11:47 ` [PATCH 2/3] dhcp-server: Fill in netmask & gateway in lease objects Andrew Zaborowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andrew Zaborowski @ 2021-07-09 11:47 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]

find_free_or_expired_ip() or check_requested_ip() should fail if no
addresses are left in the pool, rather than lease_add() so emit that
error message there.  The only thing lease_add() validates that has not
been validated before might be the origin MAC, treat the lease_add()
failure more as an internal error.
---
 ell/dhcp-server.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ell/dhcp-server.c b/ell/dhcp-server.c
index 34512ae..b761833 100644
--- a/ell/dhcp-server.c
+++ b/ell/dhcp-server.c
@@ -451,13 +451,13 @@ static void send_offer(struct l_dhcp_server *server,
 							client_msg->chaddr);
 
 	if (!reply->yiaddr) {
-		SERVER_DEBUG("Could not find lease or send offer");
+		SERVER_DEBUG("No free IP addresses, OFFER abandoned");
 		return;
 	}
 
 	lease = add_lease(server, true, client_msg->chaddr, reply->yiaddr);
 	if (!lease) {
-		SERVER_DEBUG("No free IP addresses, OFFER abandoned");
+		SERVER_DEBUG("add_lease() failed");
 		return;
 	}
 
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-09 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 11:47 [PATCH 1/3] dhcp-server: Fix debug messages in send_offer Andrew Zaborowski
2021-07-09 11:47 ` [PATCH 2/3] dhcp-server: Fill in netmask & gateway in lease objects Andrew Zaborowski
2021-07-09 11:47 ` [PATCH 3/3] dhcp-server: Add l_dhcp_server_{new,release}_lease Andrew Zaborowski
2021-07-09 15:12 ` [PATCH 1/3] dhcp-server: Fix debug messages in send_offer Denis Kenzior
2021-07-09 15:38   ` Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).