Skip to content

fix(dnstap source): fix rcode 16 handling in dnsmsg-parser #23106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Comcast
Consolas
Coolpad
BADDCAFE
BADVERS
DEBHELPER
Danew
dkr
Expand Down
3 changes: 3 additions & 0 deletions changelog.d/23106_rcode_16_dnsmsg_parser_handling.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed description for RCODE 16 (it was BADSIG previously, but it should be BADVERS).

authors: esensar Quad9DNS
4 changes: 2 additions & 2 deletions lib/dnsmsg-parser/src/dns_message_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,8 +945,8 @@ fn parse_response_code(rcode: u16) -> Option<&'static str> {
9 => Some("NotAuth"), // 9 NotAuth Server Not Authoritative for zone [RFC2136]
10 => Some("NotZone"), // 10 NotZone Name not contained in zone [RFC2136]
// backwards compat for 4 bit ResponseCodes so far.
// 16 BADVERS Bad OPT Version [RFC6891]
16 => Some("BADSIG"), // 16 BADSIG TSIG Signature Failure [RFC2845]
16 => Some("BADVERS"), // 16 BADVERS Bad OPT Version [RFC6891]
// 16 BADSIG TSIG Signature Failure [RFC2845]
17 => Some("BADKEY"), // 17 BADKEY Key not recognized [RFC2845]
18 => Some("BADTIME"), // 18 BADTIME Signature out of time window [RFC2845]
19 => Some("BADMODE"), // 19 BADMODE Bad TKEY Mode [RFC2930]
Expand Down
4 changes: 2 additions & 2 deletions lib/dnstap-parser/src/vrl_functions/parse_dnstap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl Function for ParseDnstap {
"questionTypeId": 6
}
],
"rcodeName": "BADSIG"
"rcodeName": "BADVERS"
},
"responseAddress": "2001:502:7094::30",
"responsePort": 53,
Expand Down Expand Up @@ -295,7 +295,7 @@ mod tests {
questionTypeId: 6,
}
],
rcodeName: "BADSIG",
rcodeName: "BADVERS",
},
responseAddress: "2001:502:7094::30",
responsePort: 53,
Expand Down
1 change: 1 addition & 0 deletions website/cue/reference/components/sources/dnstap.cue
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ components: sources: dnstap: {
NXRRSet: "RR Set that should exist does not"
NotAuth: "Server Not Authoritative for zone"
NotZone: "Name not contained in zone"
BADVERS: "Bad OPT Version"
BADSIG: "TSIG Signature Failure"
BADKEY: "Key not recognized"
BADTIME: "Signature out of time window"
Expand Down
2 changes: 1 addition & 1 deletion website/cue/reference/remap/functions/parse_dnstap.cue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ remap: functions: parse_dnstap: {
"questionTypeId": 6
},
]
"rcodeName": "BADSIG"
"rcodeName": "BADVERS"
}
"responseAddress": "2001:502:7094::30"
"responsePort": 53
Expand Down
Loading