From: Miod Vallat Date: Thu, 11 Sep 2025 15:21:00 +0000 (+0200) Subject: Only display "no changes made" message during update if record is unchanged. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7969a34914ffc8def23d285697bb33dea317c665;p=thirdparty%2Fpdns.git Only display "no changes made" message during update if record is unchanged. Fixes: #2353 Signed-off-by: Miod Vallat --- diff --git a/pdns/rfc2136handler.cc b/pdns/rfc2136handler.cc index 37f11da7e..20c65e95d 100644 --- a/pdns/rfc2136handler.cc +++ b/pdns/rfc2136handler.cc @@ -196,31 +196,40 @@ static uint performUpdate(DNSSECKeeper& dsk, const string &msgPrefix, const DNSR int updateTTL=0; foundRecord = false; bool lowerCase = false; - if (rrType.getCode() == QType::PTR || - rrType.getCode() == QType::MX || - rrType.getCode() == QType::SRV) { + switch (rrType.getCode()) { + case QType::MX: + case QType::PTR: + case QType::SRV: lowerCase = true; + break; } string content = rr->getContent()->getZoneRepresentation(); - if (lowerCase) content = toLower(content); + if (lowerCase) { + content = toLower(content); + } for (auto& i : rrset) { - string icontent = i.getZoneRepresentation(); - if (lowerCase) icontent = toLower(icontent); - if (rrType == i.qtype.getCode()) { + if (rrType != i.qtype.getCode()) { + continue; + } + if (!foundRecord) { + string icontent = i.getZoneRepresentation(); + if (lowerCase) { + icontent = toLower(icontent); + } if (icontent == content) { foundRecord=true; } - if (i.ttl != rr->d_ttl) { - i.ttl = rr->d_ttl; - updateTTL++; - } + } + if (i.ttl != rr->d_ttl) { + i.ttl = rr->d_ttl; + updateTTL++; } } if (updateTTL > 0) { di->backend->replaceRRSet(di->id, rr->d_name, rrType, rrset); g_log<d_name<<"|"<d_name<<"|"<