Skip to content

Commit

Permalink
Correctly sort records with a priority. Closes #2843
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterlexis committed Nov 2, 2015
1 parent edf46fe commit 2358eea
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pdns/signingpipe.cc
Expand Up @@ -109,11 +109,12 @@ ChunkedSigningPipe::~ChunkedSigningPipe()
namespace {
bool dedupLessThan(const DNSResourceRecord& a, const DNSResourceRecord &b)
{
if(tie(a.content, a.ttl) < tie(b.content, b.ttl))
return true;
if(a.qtype.getCode() == QType::MX || a.qtype.getCode() == QType::SRV)
return a.priority < b.priority;
return false;
uint16_t aprio = 0, bprio = 0;
if (a.qtype.getCode() == QType::MX || a.qtype.getCode() == QType::SRV)
aprio = a.priority;
if (b.qtype.getCode() == QType::MX || b.qtype.getCode() == QType::SRV)
bprio = b.priority;
return tie(a.content, a.ttl, aprio) < tie(b.content, b.ttl, bprio);
}

bool dedupEqual(const DNSResourceRecord& a, const DNSResourceRecord &b)
Expand Down

0 comments on commit 2358eea

Please sign in to comment.