Skip to contentSkip to conversation

dhcp-server: Fill in DNS info in lease objects

PATCH Applied Andrew Zaborowski 2 participants 2 messages Aug 28, 2021 – Aug 31, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dhcp-server: Fill in DNS info in lease objects

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(+)
ell/dhcp-server.c +7 -0
index 05f9b73..9c0628a 100644
@@ -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);
 
Signature · 1 line
2.30.2
#1 lore raw

Hi Andrew,

Quoted 7 lines · Andrew Zaborowski

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