hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit cd735b6bc01ca06f6a9878fa102c9ad8cc77de16
parent d4ef660fb1a7680bf6fa59adba9fac2321108b5f
Author: Conrad Hoffmann <ch@bitfehler.net>
Date:   Wed, 12 Jul 2023 16:28:01 +0200

net::dns: fix opcode bitmask

Signed-off-by: Conrad Hoffmann <ch@bitfehler.net>

Diffstat:
Mnet/dns/decode.ha | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dns/decode.ha b/net/dns/decode.ha @@ -86,7 +86,7 @@ fn decode_header(dec: *decoder, head: *header) (void | format) = { fn decode_op(in: u16, out: *op) void = { out.qr = ((in & 0b1000000000000000) >> 15): qr; - out.opcode = ((in & 0b01111000000000u16) >> 11): opcode; + out.opcode = ((in & 0b0111100000000000u16) >> 11): opcode; out.aa = in & 0b0000010000000000u16 != 0; out.tc = in & 0b0000001000000000u16 != 0; out.rd = in & 0b0000000100000000u16 != 0;