Skip to content

Commit

Permalink
Bug 1542561 - TRR: Don't return NS_ERROR_UNKNOWN_HOST when a AAAA res…
Browse files Browse the repository at this point in the history
…ponse comes back first, but the second A response is NXDOMAIN r=dragana

Differential Revision: https://phabricator.services.mozilla.com/D33471

--HG--
extra : moz-landing-system : lando
  • Loading branch information
valenting committed Jun 3, 2019
1 parent acdd705 commit 15ababe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions netwerk/dns/nsHostResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1741,9 +1741,14 @@ nsHostResolver::LookupStatus nsHostResolver::CompleteLookup(
// If mFirstTRR is set, merge those addresses into current set!
if (addrRec->mFirstTRR) {
if (NS_SUCCEEDED(status)) {
LOG(("Merging responses"));
merge_rrset(newRRSet, addrRec->mFirstTRR);
} else {
LOG(("Will use previous response"));
newRRSet.swap(addrRec->mFirstTRR); // transfers
// We must use the status of the first response, otherwise we'll
// pass an error result to the consumers.
status = addrRec->mFirstTRRresult;
}
addrRec->mFirstTRR = nullptr;
}
Expand Down

0 comments on commit 15ababe

Please sign in to comment.