mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
dns: fixed a bug in UnmarshalRR
This commit is contained in:
1 parent
d5e3ea539a
commit
5e32133eb9
2 files changed
+12
-20
No files matched your search
+3
-4
@@ -90,7 +90,7 @@ func (c *Client) Exchange(reqBytes []byte, clientAddr string) (respBytes []byte,
|
||||
return
|
||||
}
|
||||
|
||||
ip := ""
|
||||
ips := []string{}
|
||||
for _, answer := range respM.Answers {
|
||||
if answer.TYPE == QTypeA {
|
||||
for _, h := range c.Handlers {
|
||||
@@ -98,17 +98,16 @@ func (c *Client) Exchange(reqBytes []byte, clientAddr string) (respBytes []byte,
|
||||
}
|
||||
|
||||
if answer.IP != "" {
|
||||
ip += answer.IP + ","
|
||||
ips = append(ips, answer.IP)
|
||||
}
|
||||
}
|
||||
|
||||
log.F("rr: %+v", answer)
|
||||
}
|
||||
|
||||
// add to cache
|
||||
|
||||
log.F("[dns] %s <-> %s, type: %d, %s: %s",
|
||||
clientAddr, dnsServer, reqM.Question.QTYPE, reqM.Question.QNAME, ip)
|
||||
clientAddr, dnsServer, reqM.Question.QTYPE, reqM.Question.QNAME, strings.Join(ips, ","))
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user