From: Remi Gacogne Date: Tue, 11 Aug 2020 12:10:58 +0000 (+0200) Subject: Replace the use of '1' by QClass::IN to improve readability X-Git-Tag: rec-4.4.0-beta1~41^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=edefbffbad559ffac57efac50aa06149a333b0b0;p=thirdparty%2Fpdns.git Replace the use of '1' by QClass::IN to improve readability --- diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index a882614323..cf98e0658d 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -290,7 +290,7 @@ bool Bind2Backend::feedRecord(const DNSResourceRecord &rr, const DNSName &ordern throw DBException("out-of-zone data '"+rr.qname.toLogString()+"' during AXFR of zone '"+bbd.d_name.toLogString()+"'"); } - shared_ptr drc(DNSRecordContent::mastermake(rr.qtype.getCode(), 1, rr.content)); + shared_ptr drc(DNSRecordContent::mastermake(rr.qtype.getCode(), QClass::IN, rr.content)); string content = drc->getZoneRepresentation(); // SOA needs stripping too! XXX FIXME - also, this should not be here I think diff --git a/modules/lmdbbackend/lmdbbackend.cc b/modules/lmdbbackend/lmdbbackend.cc index b768905076..92acd5bcec 100644 --- a/modules/lmdbbackend/lmdbbackend.cc +++ b/modules/lmdbbackend/lmdbbackend.cc @@ -233,7 +233,7 @@ void serFromString(const string_view& str, DNSResourceRecord& rr) static std::string serializeContent(uint16_t qtype, const DNSName& domain, const std::string& content) { - auto drc = DNSRecordContent::mastermake(qtype, 1, content); + auto drc = DNSRecordContent::mastermake(qtype, QClass::IN, content); return drc->serialize(domain, false); } diff --git a/pdns/lua-base4.cc b/pdns/lua-base4.cc index 163f4687a0..bce88d1418 100644 --- a/pdns/lua-base4.cc +++ b/pdns/lua-base4.cc @@ -174,7 +174,7 @@ void BaseLua4::prepareContext() { d_lw->registerFunction("match", (bool (NetmaskGroup::*)(const ComboAddress&) const)&NetmaskGroup::match); // DNSRecord - d_lw->writeFunction("newDR", [](const DNSName &name, const std::string &type, unsigned int ttl, const std::string &content, int place){ QType qtype; qtype = type; auto dr = DNSRecord(); dr.d_name = name; dr.d_type = qtype.getCode(); dr.d_ttl = ttl; dr.d_content = shared_ptr(DNSRecordContent::mastermake(dr.d_type, 1, content)); dr.d_place = static_cast(place); return dr; }); + d_lw->writeFunction("newDR", [](const DNSName &name, const std::string &type, unsigned int ttl, const std::string &content, int place){ QType qtype; qtype = type; auto dr = DNSRecord(); dr.d_name = name; dr.d_type = qtype.getCode(); dr.d_ttl = ttl; dr.d_content = shared_ptr(DNSRecordContent::mastermake(dr.d_type, QClass::IN, content)); dr.d_place = static_cast(place); return dr; }); d_lw->registerMember("name", &DNSRecord::d_name); d_lw->registerMember("type", &DNSRecord::d_type); d_lw->registerMember("ttl", &DNSRecord::d_ttl); diff --git a/pdns/lua-recursor4.cc b/pdns/lua-recursor4.cc index 0890cbb4ac..79cc6d48fc 100644 --- a/pdns/lua-recursor4.cc +++ b/pdns/lua-recursor4.cc @@ -133,7 +133,7 @@ void RecursorLua4::DNSQuestion::addRecord(uint16_t type, const std::string& cont dr.d_ttl=ttl.get_value_or(3600); dr.d_type = type; dr.d_place = place; - dr.d_content = DNSRecordContent::mastermake(type, 1, content); + dr.d_content = DNSRecordContent::mastermake(type, QClass::IN, content); records.push_back(dr); } @@ -263,7 +263,7 @@ void RecursorLua4::postPrepareContext() d_lw->registerFunction("getContent", [](const ProxyProtocolValue& value) { return value.content; }); d_lw->registerFunction("getType", [](const ProxyProtocolValue& value) { return value.type; }); - d_lw->registerFunction("changeContent", [](DNSRecord& dr, const std::string& newContent) { dr.d_content = DNSRecordContent::mastermake(dr.d_type, 1, newContent); }); + d_lw->registerFunction("changeContent", [](DNSRecord& dr, const std::string& newContent) { dr.d_content = DNSRecordContent::mastermake(dr.d_type, QClass::IN, newContent); }); d_lw->registerFunction("addAnswer", &DNSQuestion::addAnswer); d_lw->registerFunction("addRecord", &DNSQuestion::addRecord); d_lw->registerFunction("getRecords", &DNSQuestion::getRecords); diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index ce1fc75625..c431835317 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -363,7 +363,7 @@ static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, con rr.content = "\""+rr.content+"\""; try { - shared_ptr drc(DNSRecordContent::mastermake(rr.qtype.getCode(), 1, rr.content)); + shared_ptr drc(DNSRecordContent::mastermake(rr.qtype.getCode(), QClass::IN, rr.content)); string tmp=drc->serialize(rr.qname); tmp = drc->getZoneRepresentation(true); if (rr.qtype.getCode() != QType::AAAA) {