Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DNS: support DNAME RRs in DNSRRs (#4249)
According to https://www.rfc-editor.org/rfc/rfc6672.html#section-2.1 ``` The DNAME RR has mnemonic DNAME and type code 39 (decimal). Its RDATA is comprised of a single field, <target>, which contains a fully qualified domain name that MUST be sent in uncompressed form ``` Even though the RFC says it MUST NOT be compressed `dns_compress` compresses it intentionally to make it easier to test DNS-related software that should be able to handle compressed and uncompressed DNAMEs regradless of what the RFC says. This patch makes it possible to work with FQDNs instead of the wire format. It was prompted by systemd/systemd#30392 where recursive DNAMEs were initially built using FQDNs (by analogy with CNAMEs) and were rejected because they weren't valid. The patch was also cross-checked with Wireshark: ``` >>> tdecode(Ether()/IP()/UDP()/DNS(qd=[], an=[DNSRR(rrname='local', type='DNAME', rdata='local')])) ... Answers local: type DNAME, class IN, dname local Name: local Type: DNAME (39) Class: IN (0x0001) Time to live: 0 (0 seconds) Data length: 7 Dname: local ```
- Loading branch information