GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — codec-dns: Fix query OPCODE bit offset and mask by hyperxpro · Pull Request #17314 · netty/netty Conversation
Contributor
Motivation: RFC 1035 section 4.1.1 puts the OPCODE in bits 14-11. Modification: Encode the OPCODE as Result: Non-QUERY opcodes are encoded where RFC 1035 puts them and round-trip through the decoder. This fixes the OPCODE field only; UPDATE still cannot be sent, because the prerequisite and update sections are dropped.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
normanmaurer
requested changes
Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
✅ All tests passed ✅🏷️ Commit: 185895f Learn more about TestLens at testlens.app/docs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Auto-port PR for 5.0: #17315 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Auto-port PR for 4.1: #17316 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Auto-port of #17314 to 4.1 Cherry-picked commit: bec5856 --- Motivation: RFC 1035 section 4.1.1 puts the OPCODE in bits 14-11. `DnsQueryEncoder` shifted by 14 and masked with `0xFF`, so every non-QUERY opcode was corrupted on the wire: NOTIFY silently became QUERY, IQUERY and UPDATE became opcode 8, and STATUS set QR, making the query a response. The response encoder and both decoders already used bits 14-11. Modification: Encode the OPCODE as `(opCode & 0xF) << 11`. Add tests over all five DnsOpCode constants: the round-trip, the exact flags word with and without RD, and an out of range opcode. Result: Non-QUERY opcodes are encoded where RFC 1035 puts them and round-trip through the decoder. This fixes the OPCODE field only; UPDATE still cannot be sent, because the prerequisite and update sections are dropped. --------- Co-authored-by: Aayush Atharva <[email protected]> Co-authored-by: Norman Maurer <[email protected]>
Auto-port of #17314 to 5.0 Cherry-picked commit: bec5856 --- Motivation: RFC 1035 section 4.1.1 puts the OPCODE in bits 14-11. `DnsQueryEncoder` shifted by 14 and masked with `0xFF`, so every non-QUERY opcode was corrupted on the wire: NOTIFY silently became QUERY, IQUERY and UPDATE became opcode 8, and STATUS set QR, making the query a response. The response encoder and both decoders already used bits 14-11. Modification: Encode the OPCODE as `(opCode & 0xF) << 11`. Add tests over all five DnsOpCode constants: the round-trip, the exact flags word with and without RD, and an out of range opcode. Result: Non-QUERY opcodes are encoded where RFC 1035 puts them and round-trip through the decoder. This fixes the OPCODE field only; UPDATE still cannot be sent, because the prerequisite and update sections are dropped. --------- Co-authored-by: Aayush Atharva <[email protected]> Co-authored-by: Norman Maurer <[email protected]>
…#17316) Auto-port of netty#17314 to 4.1 Cherry-picked commit: bec5856 --- Motivation: RFC 1035 section 4.1.1 puts the OPCODE in bits 14-11. `DnsQueryEncoder` shifted by 14 and masked with `0xFF`, so every non-QUERY opcode was corrupted on the wire: NOTIFY silently became QUERY, IQUERY and UPDATE became opcode 8, and STATUS set QR, making the query a response. The response encoder and both decoders already used bits 14-11. Modification: Encode the OPCODE as `(opCode & 0xF) << 11`. Add tests over all five DnsOpCode constants: the round-trip, the exact flags word with and without RD, and an out of range opcode. Result: Non-QUERY opcodes are encoded where RFC 1035 puts them and round-trip through the decoder. This fixes the OPCODE field only; UPDATE still cannot be sent, because the prerequisite and update sections are dropped. --------- Co-authored-by: Aayush Atharva <[email protected]> Co-authored-by: Norman Maurer <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.