mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-04 02:14:40 +01:00
More heuristics to detect valid plain DNS responses
This commit is contained in:
parent
f332394c4b
commit
6dd22becac
1 changed files with 21 additions and 17 deletions
|
@ -620,7 +620,10 @@ func fetchDNSCryptServerInfo(proxy *Proxy, name string, stamp stamps.ServerStamp
|
|||
&name,
|
||||
false,
|
||||
)
|
||||
if err == nil {
|
||||
if err == nil && len(msg.Question) > 0 {
|
||||
question := msg.Question[0]
|
||||
if question.Qtype == query.Question[0].Qtype && strings.EqualFold(question.Name, query.Question[0].Name) {
|
||||
dlog.Debugf("[%s] also serves plaintext DNS", name)
|
||||
if msg.Id != 0xcafe {
|
||||
dlog.Infof("[%s] handling of DNS message identifiers is broken", name)
|
||||
}
|
||||
|
@ -643,6 +646,7 @@ func fetchDNSCryptServerInfo(proxy *Proxy, name string, stamp stamps.ServerStamp
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ServerInfo{
|
||||
Proto: stamps.StampProtoTypeDNSCrypt,
|
||||
|
|
Loading…
Add table
Reference in a new issue