mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 19:56:51 +08:00
Chore: adjust tun RelayDnsPacket
This commit is contained in:
parent
c6efa74a6b
commit
4a4b1bdb83
|
@ -28,15 +28,9 @@ func RelayDnsPacket(payload []byte) ([]byte, error) {
|
|||
|
||||
r, err := resolver.ServeMsg(msg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, ans := range r.Answer {
|
||||
header := ans.Header()
|
||||
|
||||
if header.Class == D.ClassINET && (header.Rrtype == D.TypeA || header.Rrtype == D.TypeAAAA) {
|
||||
header.Ttl = 1
|
||||
}
|
||||
m := new(D.Msg)
|
||||
m.SetRcode(msg, D.RcodeServerFailure)
|
||||
return m.Pack()
|
||||
}
|
||||
|
||||
r.SetRcode(msg, r.Rcode)
|
||||
|
|
Loading…
Reference in New Issue
Block a user