From ceae2bbab0a49d5e585f2e0ab2090060e8af6c43 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 28 Sep 2024 16:11:51 +0530 Subject: [PATCH] Scope: updated GetClientFullyQualifiedDomainNameOption() to sanitize hostname before using it to generate client domain name. --- DnsServerCore/Dhcp/Scope.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DnsServerCore/Dhcp/Scope.cs b/DnsServerCore/Dhcp/Scope.cs index 7c3516bb..2fe29f9a 100644 --- a/DnsServerCore/Dhcp/Scope.cs +++ b/DnsServerCore/Dhcp/Scope.cs @@ -574,7 +574,7 @@ namespace DnsServerCore.Dhcp if (!string.IsNullOrWhiteSpace(reservedLeaseHostName)) { //domain name override by server - clientDomainName = reservedLeaseHostName + "." + _domainName; + clientDomainName = DhcpServer.GetSanitizedHostName(reservedLeaseHostName) + "." + _domainName; } else if (string.IsNullOrWhiteSpace(request.ClientFullyQualifiedDomainName.DomainName)) { @@ -582,7 +582,7 @@ namespace DnsServerCore.Dhcp if (request.HostName is null) return null; //server unable to decide a name for client - clientDomainName = request.HostName.HostName + "." + _domainName; + clientDomainName = DhcpServer.GetSanitizedHostName(request.HostName.HostName) + "." + _domainName; } else if (request.ClientFullyQualifiedDomainName.DomainName.Contains('.')) {