From: Fred Morcos Date: Wed, 15 Feb 2023 15:03:43 +0000 (+0100) Subject: Remove makeOpt from dnsrecords X-Git-Tag: dnsdist-1.8.0-rc1~3^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f89a3002620ce0484f957c9d876043b903ae1ae4;p=thirdparty%2Fpdns.git Remove makeOpt from dnsrecords --- diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index 80417bae6b..aab8577513 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -888,25 +888,6 @@ bool getEDNSOpts(const MOADNSParser& mdp, EDNSOpts* eo) return false; } -DNSRecord makeOpt(const uint16_t udpsize, const uint16_t /* extRCode */, const uint16_t extFlags) -{ - EDNS0Record stuff; - stuff.extRCode=0; - stuff.version=0; - stuff.extFlags=htons(extFlags); - DNSRecord dr; - static_assert(sizeof(EDNS0Record) == sizeof(dr.d_ttl), "sizeof(EDNS0Record) must match sizeof(DNSRecord.d_ttl)"); - memcpy(&dr.d_ttl, &stuff, sizeof(stuff)); - dr.d_ttl=ntohl(dr.d_ttl); - dr.d_name=g_rootdnsname; - dr.d_type = QType::OPT; - dr.d_class=udpsize; - dr.d_place=DNSResourceRecord::ADDITIONAL; - dr.d_content = std::make_shared(); - // if we ever do options, I think we stuff them into OPTRecordContent::data - return dr; -} - void reportBasicTypes() { ARecordContent::report(); diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index 19fa6eef55..3974084b4e 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -1055,7 +1055,6 @@ struct EDNSOpts class MOADNSParser; bool getEDNSOpts(const MOADNSParser& mdp, EDNSOpts* eo); -DNSRecord makeOpt(const uint16_t udpsize, const uint16_t extRCode, const uint16_t extFlags); void reportBasicTypes(); void reportOtherTypes(); void reportAllTypes();