mirage / ocaml-dns

OCaml implementation of the DNS protocol
BSD 2-Clause "Simplified" License
105 stars 43 forks source link

label compression inconsistencies #233

Open hannesm opened 4 years ago

hannesm commented 4 years ago

I re-read the name compression code (while investigating the AXFR struggle), and what occured to me:

the decoder thus should be made more robust and peek at the offset unless it is in the map. I as well remember some RFC describing which RR types allow compression -- SRV is a good example (2052 required it, 2782 disallows it).

in any case, the decoder should be made more robust (including test case). I don't think the encoder needs any change (it could be more conservative, and not even record the offsets (and thus not use them) of labels encoded by RR that have compression disabled. Eventually check with other software or people.

hannesm commented 4 years ago

In Section 4 of https://tools.ietf.org/html/rfc3597 it is clarified where compression may be used: owner name and the RFC 1035 resource records.