Remove compression from AFSDB (#704)
This type should not compress its rdata. Fixes #521
This commit is contained in:
parent
ed07089f3b
commit
e7c3f513a1
2
types.go
2
types.go
|
@ -330,7 +330,7 @@ func (rr *MX) String() string {
|
||||||
type AFSDB struct {
|
type AFSDB struct {
|
||||||
Hdr RR_Header
|
Hdr RR_Header
|
||||||
Subtype uint16
|
Subtype uint16
|
||||||
Hostname string `dns:"cdomain-name"`
|
Hostname string `dns:"domain-name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rr *AFSDB) String() string {
|
func (rr *AFSDB) String() string {
|
||||||
|
|
|
@ -109,9 +109,6 @@ func compressionLenHelperType(c map[string]int, r RR, initLen int) int {
|
||||||
|
|
||||||
func compressionLenSearchType(c map[string]int, r RR) (int, bool, int) {
|
func compressionLenSearchType(c map[string]int, r RR) (int, bool, int) {
|
||||||
switch x := r.(type) {
|
switch x := r.(type) {
|
||||||
case *AFSDB:
|
|
||||||
k1, ok1, sz1 := compressionLenSearch(c, x.Hostname)
|
|
||||||
return k1, ok1, sz1
|
|
||||||
case *CNAME:
|
case *CNAME:
|
||||||
k1, ok1, sz1 := compressionLenSearch(c, x.Target)
|
k1, ok1, sz1 := compressionLenSearch(c, x.Target)
|
||||||
return k1, ok1, sz1
|
return k1, ok1, sz1
|
||||||
|
|
2
zmsg.go
2
zmsg.go
|
@ -42,7 +42,7 @@ func (rr *AFSDB) pack(msg []byte, off int, compression map[string]int, compress
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return off, err
|
return off, err
|
||||||
}
|
}
|
||||||
off, err = PackDomainName(rr.Hostname, msg, off, compression, compress)
|
off, err = PackDomainName(rr.Hostname, msg, off, compression, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return off, err
|
return off, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue