From 0b0b8d9e06139d41ebf7e304fe8b80bf1fae6448 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 2 Sep 2016 12:43:13 -0400 Subject: m_dnsbl Use FindAnswerOfType --- src/modules/m_dnsbl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 44328480e..73ecd02a6 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -66,7 +66,9 @@ class DNSBLResolver : public DNS::Request if (!them) return; - const DNS::ResourceRecord &ans_record = r->answers[0]; + const DNS::ResourceRecord* const ans_record = r->FindAnswerOfType(DNS::QUERY_A); + if (!ans_record) + return; int i = countExt.get(them); if (i) @@ -78,7 +80,7 @@ class DNSBLResolver : public DNS::Request bool match = false; in_addr resultip; - inet_aton(ans_record.rdata.c_str(), &resultip); + inet_aton(ans_record->rdata.c_str(), &resultip); switch (ConfEntry->type) { -- cgit v1.2.3