From 2f230033794fafdf10822568e763d4db68cf6c6b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 23:14:49 +0200 Subject: Merging upstream version 1.9.3. Signed-off-by: Daniel Baumann --- dnsdist-secpoll.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'dnsdist-secpoll.cc') diff --git a/dnsdist-secpoll.cc b/dnsdist-secpoll.cc index eb38d35..26c48ba 100644 --- a/dnsdist-secpoll.cc +++ b/dnsdist-secpoll.cc @@ -36,6 +36,7 @@ #include "sstuff.hh" #include "dnsdist.hh" +#include "dnsdist-metrics.hh" #include "dnsdist-random.hh" #ifndef PACKAGEVERSION @@ -48,7 +49,7 @@ static std::string getFirstTXTAnswer(const std::string& answer) throw std::runtime_error("Looking for a TXT record in an answer smaller than the DNS header"); } - const struct dnsheader* dh = reinterpret_cast(answer.data()); + const dnsheader_aligned dh(answer.data()); PacketReader pr(answer); uint16_t qdcount = ntohs(dh->qdcount); uint16_t ancount = ntohs(dh->ancount); @@ -210,21 +211,21 @@ void doSecPoll(const std::string& suffix) int securityStatus = std::stoi(split.first); std::string securityMessage = split.second; - if(securityStatus == 1 && !g_secPollDone) { - warnlog("Polled security status of version %s at startup, no known issues reported: %s", std::string(VERSION), securityMessage); + if (securityStatus == 1 && !g_secPollDone) { + infolog("Polled security status of version %s at startup, no known issues reported: %s", std::string(VERSION), securityMessage); } - if(securityStatus == 2) { + if (securityStatus == 2) { errlog("PowerDNS DNSDist Security Update Recommended: %s", securityMessage); } else if(securityStatus == 3) { errlog("PowerDNS DNSDist Security Update Mandatory: %s", securityMessage); } - g_stats.securityStatus = securityStatus; + dnsdist::metrics::g_stats.securityStatus = securityStatus; g_secPollDone = true; return; } - catch(const std::exception& e) { + catch (const std::exception& e) { if (releaseVersion) { warnlog("Error while retrieving the security update for version %s: %s", version, e.what()); } -- cgit v1.2.3