fix(netxlite): reject replies with wrong queryID (#732)

This diff has been extracted from c2f7ccab0e

See https://github.com/ooni/probe/issues/2096

While there, export DecodeReply to decode a raw reply without
interpreting the Rcode or parsing the results, which seems a
nice extra feature to have to more flexibly parse DNS replies
in other parts of the codebase.
This commit is contained in:
Simone Basso 2022-05-14 19:38:46 +02:00 committed by GitHub
commit 9d2301cae2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 261 additions and 128 deletions

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// Generated: 2022-05-13 19:09:07.343096 +0200 CEST m=+0.512294417
// Generated: 2022-05-14 18:04:43.744122 +0200 CEST m=+0.315992417
package netxlite
@ -25,6 +25,7 @@ const (
FailureDNSNoAnswer = "dns_no_answer"
FailureDNSNonRecoverableFailure = "dns_non_recoverable_failure"
FailureDNSRefusedError = "dns_refused_error"
FailureDNSReplyWithWrongQueryID = "dns_reply_with_wrong_query_id"
FailureDNSServerMisbehaving = "dns_server_misbehaving"
FailureDNSServfailError = "dns_servfail_error"
FailureDNSTemporaryFailure = "dns_temporary_failure"
@ -75,6 +76,7 @@ var failuresMap = map[string]string{
"dns_non_recoverable_failure": "dns_non_recoverable_failure",
"dns_nxdomain_error": "dns_nxdomain_error",
"dns_refused_error": "dns_refused_error",
"dns_reply_with_wrong_query_id": "dns_reply_with_wrong_query_id",
"dns_server_misbehaving": "dns_server_misbehaving",
"dns_servfail_error": "dns_servfail_error",
"dns_temporary_failure": "dns_temporary_failure",