mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-11 11:40:12 +08:00
cleanup fakedns package
This commit is contained in:
19
component/fakedns/utils.go
Normal file
19
component/fakedns/utils.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package fakedns
|
||||
|
||||
import (
|
||||
D "github.com/miekg/dns"
|
||||
)
|
||||
|
||||
func setMsgTTL(msg *D.Msg, ttl uint32) {
|
||||
for _, answer := range msg.Answer {
|
||||
answer.Header().Ttl = ttl
|
||||
}
|
||||
|
||||
for _, ns := range msg.Ns {
|
||||
ns.Header().Ttl = ttl
|
||||
}
|
||||
|
||||
for _, extra := range msg.Extra {
|
||||
extra.Header().Ttl = ttl
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user