mafintosh / dns-packet

An abstract-encoding compliant module for encoding / decoding DNS packets
MIT License
201 stars 70 forks source link

Mark flush in the questions part from MSB of class value #56

Closed coolengineer closed 1 year ago

coolengineer commented 4 years ago

I found many mdns query packets have cache-flush bit set. But when those packets are received, they spoil questions part as wrong class value, while the cache-flush bit in answer part is well treated with 'flush' value of result object.

I added flush marking part to questions part, which is copied from anwer decoding part.

Supereg commented 4 years ago

The highest bit is not the cache-flush bit. The highest bit of a qclass indicates the QU flag (aka unicast response) RFC 6762 Section 18.12.

So the property should be renamed accordingly and you may use the QU_MASK instead. Additionally it would be great to add the ability to set the flag on the encoder as well.