fix: correct nsec record writing by bdraco · Pull Request #1326 · python-zeroconf/python-zeroconf
- The window and length should be been a single byte instead of a short per https://datatracker.ietf.org/doc/html/rfc3845#section-2.1.2
- Trying to convert an empty nsec record or one with an rdtype > 255 will now raise a
ValueErrorto ensure we cannot write invalid records
dns python can parse the message now
>>> import dns.message
>>> dns.message.from_wire(b'\x00\x00\x80\x00\x00\x00\x00\x01\x00\x00\x00\x00\x13eufy HomeBase2-2464\x04_hap\x04_tcp\x05local\x00\x00/\x80\x01\x00\x00\x11\x94\x00\t\xc0\x0c\x00\x05\x00\x00\x80\x00@')
[<dns.wire.Parser object at 0x1029e2060>, 7]
[(0, b'\x00\x00\x80\x00@')]
<DNS message, ID 0>
This may be the issue above, or the issues below may be bugs in the mdns stacks that are consuming the NSEC records not allowing the name compression
- The problem may be with the mdns stacks that are consuming the NSEC records and as they may assume that name compression is not allowed but using name compression seems right though since https://stackoverflow.com/questions/42986556/how-to-resolve-a-conflict-between-rfcs