Bug 1688228 - Introduce TRR_NXDOMAIN skip reason and record it when an rcode value of 0x03 is received. r=valentin,necko-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D102774
This commit is contained in:
Nihanth Subramanya 2021-02-06 13:00:36 +00:00
parent edaeca08d4
commit 48840a82cd
2 changed files with 3 additions and 1 deletions

View File

@ -456,7 +456,8 @@ nsresult DNSPacket::DecodeInternal(
LOG(("TRR Decode %s RCODE %d\n", aHost.get(), rcode));
if (rcode) {
if (aReason == nsHostRecord::TRR_UNSET) {
aReason = nsHostRecord::TRR_RCODE_FAIL;
aReason = rcode == 0x03 ? nsHostRecord::TRR_NXDOMAIN
: nsHostRecord::TRR_RCODE_FAIL;
}
}

View File

@ -119,6 +119,7 @@ class nsHostRecord : public mozilla::LinkedListElement<RefPtr<nsHostRecord>>,
TRR_SERVER_RESPONSE_ERR = 27, // Server responded with non-200 code
TRR_RCODE_FAIL = 28, // DNS response contains a non-NOERROR rcode
TRR_NO_CONNECTIVITY = 29, // Not confirmed because of no connectivity
TRR_NXDOMAIN = 30, // DNS response contains NXDOMAIN rcode (0x03)
};
// Records the first reason that caused TRR to be skipped or to fail.