Skip to content

Commit

Permalink
Remove potential double SOA records if the target of a dns64 name is …
Browse files Browse the repository at this point in the history
…NODATA

(cherry picked from commit 40d6329)
  • Loading branch information
omoerbeek committed Jun 25, 2024
1 parent 1cf80c0 commit dadf709
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pdns/recursordist/pdns_recursor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,24 @@ int getFakeAAAARecords(const DNSName& qname, ComboAddress prefix, vector<DNSReco
}),
ret.end());
}
else {
// Remove double SOA records
std::set<DNSName> seenSOAs;
ret.erase(std::remove_if(
ret.begin(),
ret.end(),
[&seenSOAs](DNSRecord& record) {
if (record.d_type == QType::SOA) {
if (seenSOAs.count(record.d_name) > 0) {
// We've had this SOA before, remove it
return true;
}
seenSOAs.insert(record.d_name);
}
return false;
}),
ret.end());
}
t_Counters.at(rec::Counter::dns64prefixanswers)++;
return rcode;
}
Expand Down

0 comments on commit dadf709

Please sign in to comment.