Stop compressing names in RT records (#847)
* Stop compressing names in RT records Although RFC 1183 allows names in the RT record to be compressed with: "The concrete encoding is identical to the MX RR." RFC 3597 specifically prohibits compressing names in any record not defined in RFC 1035. * Add comment to RT struct regarding compression
This commit is contained in:
parent
8d24af5fb5
commit
6b6e08b48c
2
types.go
2
types.go
|
@ -353,7 +353,7 @@ func (rr *X25) String() string {
|
||||||
type RT struct {
|
type RT struct {
|
||||||
Hdr RR_Header
|
Hdr RR_Header
|
||||||
Preference uint16
|
Preference uint16
|
||||||
Host string `dns:"cdomain-name"`
|
Host string `dns:"domain-name"` // RFC 3597 prohibits compressing records not defined in RFC 1035.
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rr *RT) String() string {
|
func (rr *RT) String() string {
|
||||||
|
|
2
zmsg.go
2
zmsg.go
|
@ -1070,7 +1070,7 @@ func (rr *RT) pack(msg []byte, off int, compression map[string]int, compress boo
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return off, err
|
return off, err
|
||||||
}
|
}
|
||||||
off, err = PackDomainName(rr.Host, msg, off, compression, compress)
|
off, err = PackDomainName(rr.Host, msg, off, compression, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return off, err
|
return off, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -525,7 +525,7 @@ func (rr *RRSIG) len(off int, compression map[string]struct{}) int {
|
||||||
func (rr *RT) len(off int, compression map[string]struct{}) int {
|
func (rr *RT) len(off int, compression map[string]struct{}) int {
|
||||||
l := rr.Hdr.len(off, compression)
|
l := rr.Hdr.len(off, compression)
|
||||||
l += 2 // Preference
|
l += 2 // Preference
|
||||||
l += domainNameLen(rr.Host, off+l, compression, true)
|
l += domainNameLen(rr.Host, off+l, compression, false)
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
func (rr *SMIMEA) len(off int, compression map[string]struct{}) int {
|
func (rr *SMIMEA) len(off int, compression map[string]struct{}) int {
|
||||||
|
|
Loading…
Reference in New Issue