mirror of
https://github.com/daeuniverse/dae.git
synced 2024-12-22 16:24:40 +07:00
fix: compatible issue when DNS msg not be compressed (#646)
Co-authored-by: mzz2017 <2017@duck.com>
This commit is contained in:
parent
a70b6bd9b6
commit
a7675988d8
@ -166,6 +166,7 @@ func (c *DnsController) LookupDnsRespCache_(msg *dnsmessage.Msg, cacheKey string
|
||||
cache := c.LookupDnsRespCache(cacheKey, ignoreFixedTtl)
|
||||
if cache != nil {
|
||||
cache.FillInto(msg)
|
||||
msg.Compress = true
|
||||
b, err := msg.Pack()
|
||||
if err != nil {
|
||||
c.log.Warnf("failed to pack: %v", err)
|
||||
@ -497,6 +498,7 @@ func (c *DnsController) sendReject_(dnsMessage *dnsmessage.Msg, req *udpRequest)
|
||||
dnsMessage.Response = true
|
||||
dnsMessage.RecursionAvailable = true
|
||||
dnsMessage.Truncated = false
|
||||
dnsMessage.Compress = true
|
||||
if c.log.IsLevelEnabled(logrus.TraceLevel) {
|
||||
c.log.WithFields(logrus.Fields{
|
||||
"question": dnsMessage.Question,
|
||||
@ -756,6 +758,7 @@ func (c *DnsController) dialSend(invokingDepth int, req *udpRequest, data []byte
|
||||
if needResp {
|
||||
// Keep the id the same with request.
|
||||
respMsg.Id = id
|
||||
respMsg.Compress = true
|
||||
data, err = respMsg.Pack()
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user