From 773d5d3b9d6625a2a10f3fcc3dd0236e1b4436eb Mon Sep 17 00:00:00 2001 From: nadoo <287492+nadoo@users.noreply.github.com> Date: Sun, 23 Jan 2022 00:42:54 +0800 Subject: [PATCH] dns: fixed an issue --- dns/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/client.go b/dns/client.go index 8fc5d5f..cca2239 100644 --- a/dns/client.go +++ b/dns/client.go @@ -67,8 +67,8 @@ func (c *Client) Exchange(reqBytes []byte, clientAddr string, preferTCP bool) ([ } if c.config.NoAAAA && req.Question.QTYPE == QTypeAAAA { - reqBytes[2] |= uint8(ResponseMsg) << 7 - return reqBytes, nil + req.SetMsgType(ResponseMsg) + return req.Marshal() } if req.Question.QTYPE == QTypeA || req.Question.QTYPE == QTypeAAAA {