Conversation
RFC 1035 maps each WKS bit to a protocol port, so ports above 65535 and bitmaps longer than 8192 octets are invalid. Trailing zero octets from the wire are dropped so the record matches the text form. Fixes rthalley#1309
|
RFC 1035 probably should have made the restrictions you suggest, as they are sensible; but it didn't. The text allows longer bitmaps and does not specify a canonical form. |
|
To give a little more info... After much debate, the maintainers haven't found a solution they really like. We agree the RFC ought to have been written more strictly. We also note that silent truncation of trailing zeros will break DNSSEC signatures of the data, so we don't love that. It would be better to tolerate the zeros or FORMERR them, though we don't like the FORMERR much either. Not being happy with any of the menu of alternatives we considered, we're currently thinking "WKS has been in disfavor since 1989 or so, and is not worth worrying about". |
|
Thanks for the context — especially the DNSSEC point on silent truncation. Closing this; no strong reason to change WKS if it's effectively historic. |
Fixes #1309.
RFC 1035 §3.4.2 maps each bit in a WKS bitmap to a protocol port. Ports are 16-bit values, so a presentation-form port above 65535 is not a valid WKS record, and a wire bitmap cannot be longer than 8192 octets.
from_textcurrently accepts65536(and larger) and builds a bitmap past that limit.from_wirealso keeps trailing zero octets, so a padded wire form is not equal to the same ports parsed from text.This change:
SyntaxErrorfor a port outside 0–65535 in presentation formFormErrorfor a wire bitmap longer than 8192 octets