ResolverDnsCache: prefering auth response when there is a tie with cache.

This commit is contained in:
Shreyas Zare
2021-01-16 15:53:02 +05:30
parent 28cd0ec343
commit 57e856a92e

View File

@@ -1,6 +1,6 @@
/*
Technitium DNS Server
Copyright (C) 2020 Shreyas Zare (shreyas@technitium.com)
Copyright (C) 2021 Shreyas Zare (shreyas@technitium.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -55,7 +55,7 @@ namespace DnsServerCore.Dns
if ((authResponse.Authority.Count > 0) && (cacheResponse.Authority.Count > 0))
{
if (authResponse.Authority[0].Name.Length > cacheResponse.Authority[0].Name.Length)
if (authResponse.Authority[0].Name.Length >= cacheResponse.Authority[0].Name.Length)
return authResponse;
return cacheResponse;