Merge: * dns: enable DNS message compression

Close #1109

* commit '3b443bc9c80c39483f28a042886f53feb4aeed96':
  * dns: enable DNS message compression
This commit is contained in:
Simon Zolin 2019-10-23 20:06:18 +03:00
commit 41649418fc
1 changed files with 4 additions and 1 deletions

View File

@ -432,7 +432,6 @@ func (s *Server) handleDNSRequest(p *proxy.Proxy, d *proxy.DNSContext) error {
if res.Reason == dnsfilter.ReasonRewrite && len(res.CanonName) != 0 {
d.Req.Question[0] = originalQuestion
d.Res.Question[0] = originalQuestion
if len(d.Res.Answer) != 0 {
answer = append(answer, d.Res.Answer...) // host -> IP
@ -441,6 +440,10 @@ func (s *Server) handleDNSRequest(p *proxy.Proxy, d *proxy.DNSContext) error {
}
}
if d.Res != nil {
d.Res.Compress = true // some devices require DNS message compression
}
shouldLog := true
msg := d.Req