From: bert hubert Date: Thu, 11 Feb 2016 10:37:24 +0000 (+0100) Subject: liberate getAddr() helper from sortlist.cc for wider use X-Git-Tag: auth-4.0.0-alpha2~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1ae49f7c05ebfedd3130f349c8a5eca6ddbdfd2;p=thirdparty%2Fpdns.git liberate getAddr() helper from sortlist.cc for wider use --- diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index 9bf357e322..a2775bdbea 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -608,6 +608,16 @@ void reportAllTypes() reportOtherTypes(); } +ComboAddress getAddr(const DNSRecord& dr, uint16_t defport) +{ + if(auto addr=getRR(dr)) { + return addr->getCA(defport); + } + else + return getRR(dr)->getCA(defport); +} + + #if 0 static struct Reporter { diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index 0cdff09b8c..91df95aab3 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -708,5 +708,5 @@ DNSRecord makeOpt(int udpsize, int extRCode, int Z); void reportBasicTypes(); void reportOtherTypes(); void reportAllTypes(); - +ComboAddress getAddr(const DNSRecord& dr, uint16_t defport=0); #endif diff --git a/pdns/sortlist.cc b/pdns/sortlist.cc index 4a014f04d7..f840844f0c 100644 --- a/pdns/sortlist.cc +++ b/pdns/sortlist.cc @@ -52,14 +52,6 @@ bool SortListOrderCmp::operator()(const ComboAddress& a, const ComboAddress& b) return aOrder < bOrder; } -static ComboAddress getAddr(const DNSRecord& dr) -{ - if(auto addr=getRR(dr)) { - return addr->getCA(); - } - else - return getRR(dr)->getCA(); -} bool SortListOrderCmp::operator()(const DNSRecord& ar, const DNSRecord& br) const { if(ar.d_type < br.d_type)