dns: just return the request packet back when dnsnoaaaa enabled

This commit is contained in:
nadoo 2022-01-23 11:09:35 +08:00
parent 773d5d3b9d
commit d3fbef02bb

View File

@ -67,8 +67,9 @@ func (c *Client) Exchange(reqBytes []byte, clientAddr string, preferTCP bool) ([
}
if c.config.NoAAAA && req.Question.QTYPE == QTypeAAAA {
req.SetMsgType(ResponseMsg)
return req.Marshal()
respBytes := valCopy(reqBytes)
respBytes[2] |= uint8(ResponseMsg) << 7
return respBytes, nil
}
if req.Question.QTYPE == QTypeA || req.Question.QTYPE == QTypeAAAA {