From a725879238540d73c8e782f7bb3101de8a90459d Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Mon, 15 Nov 2021 16:28:58 +0100 Subject: [PATCH] auth 2136: apply new TTL to whole RRset, not only to the added record fixes #10921 --- pdns/rfc2136handler.cc | 10 ++++++---- .../tests/1dyndns-update-add-delete-mx/expected_result | 8 ++++---- .../1dyndns-update-delete-mx-prio/expected_result | 4 ++-- .../tests/1dyndns-update-replace-mx/expected_result | 2 +- .../tests/1dyndns-update-srv/expected_result | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/pdns/rfc2136handler.cc b/pdns/rfc2136handler.cc index be1d3aa521..ea985b35c0 100644 --- a/pdns/rfc2136handler.cc +++ b/pdns/rfc2136handler.cc @@ -194,8 +194,10 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, for (auto& i : rrset) { string icontent = i.getZoneRepresentation(); if (lowerCase) icontent = toLower(icontent); - if (rrType == i.qtype.getCode() && icontent == content) { - foundRecord=true; + if (rrType == i.qtype.getCode()) { + if (icontent == content) { + foundRecord=true; + } if (i.ttl != rr->d_ttl) { i.ttl = rr->d_ttl; updateTTL++; @@ -204,10 +206,10 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, } if (updateTTL > 0) { di->backend->replaceRRSet(di->id, rr->d_name, rrType, rrset); - g_log<d_name<<"|"<d_name<<"|"<d_name<<"|"<d_name<<"|"<