Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

label compression inconsistencies #233

Open
hannesm opened this issue Jul 1, 2020 · 1 comment
Open

label compression inconsistencies #233

hannesm opened this issue Jul 1, 2020 · 1 comment

Comments

@hannesm
Copy link
Member

hannesm commented Jul 1, 2020

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

  • the encoder inserts, independent of ~compress, all labels into the map (this is fine i think)
  • the decoder emits a `P of int for all pointers, and then assumes them being in the map. this may not be the case for an (unknown) resource record type which is not decoded (i.e. treat as binary data)

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
Copy link
Member Author

hannesm commented Jul 23, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant