From e1dc278ff3a5f4a6dfa50a2c9a2831cfe6833055 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 9 Apr 2022 17:33:55 +0530 Subject: [PATCH] PrimaryZone: updated GetZoneSoaMinimum() to get the minimum value only. Updated SetRecords() to use the minimum property directly. --- DnsServerCore/Dns/Zones/PrimaryZone.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/DnsServerCore/Dns/Zones/PrimaryZone.cs b/DnsServerCore/Dns/Zones/PrimaryZone.cs index 02464d20..b183fd90 100644 --- a/DnsServerCore/Dns/Zones/PrimaryZone.cs +++ b/DnsServerCore/Dns/Zones/PrimaryZone.cs @@ -2374,12 +2374,7 @@ namespace DnsServerCore.Dns.Zones private uint GetZoneSoaMinimum() { - return GetZoneSoaMinimum(_entries[DnsResourceRecordType.SOA][0]); - } - - private uint GetZoneSoaMinimum(DnsResourceRecord soaRecord) - { - return Math.Min((soaRecord.RDATA as DnsSOARecordData).Minimum, soaRecord.OriginalTtlValue); + return (_entries[DnsResourceRecordType.SOA][0].RDATA as DnsSOARecordData).Minimum; } internal uint GetZoneSoaExpire() @@ -2590,9 +2585,7 @@ namespace DnsServerCore.Dns.Zones CommitAndIncrementSerial(); - uint newSoaMinimum = GetZoneSoaMinimum(soaRecord); - - if (oldSoaMinimum != newSoaMinimum) + if (oldSoaMinimum != soa.Minimum) { switch (_dnssecStatus) {