mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-10 11:09:52 +08:00
fix: leak dns when domain in hosts list
This commit is contained in:
parent
a589d6c71f
commit
1b9a952510
@ -46,11 +46,11 @@ func withHosts(hosts *trie.DomainTrie[netip.Addr], mapping *cache.LruCache[netip
|
|||||||
rr.A = ip.AsSlice()
|
rr.A = ip.AsSlice()
|
||||||
|
|
||||||
msg.Answer = []D.RR{rr}
|
msg.Answer = []D.RR{rr}
|
||||||
} else if ip.Is6() && q.Qtype == D.TypeAAAA {
|
} else if q.Qtype == D.TypeAAAA {
|
||||||
rr := &D.AAAA{}
|
rr := &D.AAAA{}
|
||||||
rr.Hdr = D.RR_Header{Name: q.Name, Rrtype: D.TypeAAAA, Class: D.ClassINET, Ttl: 10}
|
rr.Hdr = D.RR_Header{Name: q.Name, Rrtype: D.TypeAAAA, Class: D.ClassINET, Ttl: 10}
|
||||||
rr.AAAA = ip.AsSlice()
|
ip := ip.As16()
|
||||||
|
rr.AAAA = ip[:]
|
||||||
msg.Answer = []D.RR{rr}
|
msg.Answer = []D.RR{rr}
|
||||||
} else {
|
} else {
|
||||||
return next(ctx, r)
|
return next(ctx, r)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user