Move compress=false out of packDataDomainNames into caller (#849)
This makes packDataDomainNames more consistent with PackDomainName where it will only be called with compress = true for `dns:"cdomain-name"`.
This commit is contained in:
parent
778aa4f83d
commit
6ade5b5fff
|
@ -106,7 +106,7 @@ return off, err
|
|||
case `dns:"nsec"`:
|
||||
o("off, err = packDataNsec(rr.%s, msg, off)\n")
|
||||
case `dns:"domain-name"`:
|
||||
o("off, err = packDataDomainNames(rr.%s, msg, off, compression, compress)\n")
|
||||
o("off, err = packDataDomainNames(rr.%s, msg, off, compression, false)\n")
|
||||
default:
|
||||
log.Fatalln(name, st.Field(i).Name(), st.Tag(i))
|
||||
}
|
||||
|
|
|
@ -624,7 +624,7 @@ func unpackDataDomainNames(msg []byte, off, end int) ([]string, int, error) {
|
|||
func packDataDomainNames(names []string, msg []byte, off int, compression map[string]int, compress bool) (int, error) {
|
||||
var err error
|
||||
for j := 0; j < len(names); j++ {
|
||||
off, err = PackDomainName(names[j], msg, off, compression, false && compress)
|
||||
off, err = PackDomainName(names[j], msg, off, compression, compress)
|
||||
if err != nil {
|
||||
return len(msg), err
|
||||
}
|
||||
|
|
2
zmsg.go
2
zmsg.go
|
@ -438,7 +438,7 @@ func (rr *HIP) pack(msg []byte, off int, compression map[string]int, compress bo
|
|||
if err != nil {
|
||||
return off, err
|
||||
}
|
||||
off, err = packDataDomainNames(rr.RendezvousServers, msg, off, compression, compress)
|
||||
off, err = packDataDomainNames(rr.RendezvousServers, msg, off, compression, false)
|
||||
if err != nil {
|
||||
return off, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue