ell.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] dhcp-server: Fill in DNS info in lease objects
@ 2021-08-28  3:06 Andrew Zaborowski
  2021-08-31 13:26 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Zaborowski @ 2021-08-28  3:06 UTC (permalink / raw)
  To: ell

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

Copy the DNS info that we send to the client also to the lease object
that we keep on our side for our own tracking, same as we copy the IP,
the gateway, the netmask etc.
---
 ell/dhcp-server.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ell/dhcp-server.c b/ell/dhcp-server.c
index 05f9b73..9c0628a 100644
--- a/ell/dhcp-server.c
+++ b/ell/dhcp-server.c
@@ -316,6 +316,13 @@ static struct l_dhcp_lease *add_lease(struct l_dhcp_server *server,
 	lease->subnet_mask = server->netmask;
 	lease->router = server->gateway;
 
+	if (server->dns_list) {
+		unsigned int i;
+
+		for (i = 0; server->dns_list[i]; i++);
+		lease->dns = l_memdup(server->dns_list, (i + 1) * 4);
+	}
+
 	if (client_id)
 		lease->client_id = l_memdup(client_id, client_id[0] + 1);
 
-- 
2.30.2

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

* Re: [PATCH] dhcp-server: Fill in DNS info in lease objects
  2021-08-28  3:06 [PATCH] dhcp-server: Fill in DNS info in lease objects Andrew Zaborowski
@ 2021-08-31 13:26 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-08-31 13:26 UTC (permalink / raw)
  To: ell

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

Hi Andrew,

On 8/27/21 10:06 PM, Andrew Zaborowski wrote:
> Copy the DNS info that we send to the client also to the lease object
> that we keep on our side for our own tracking, same as we copy the IP,
> the gateway, the netmask etc.
> ---
>   ell/dhcp-server.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 

Applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2021-08-31 13:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  3:06 [PATCH] dhcp-server: Fill in DNS info in lease objects Andrew Zaborowski
2021-08-31 13:26 ` 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).