Skip to content

Commit

Permalink
Fix: DNS return value (#1242)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loyalsoldier committed Aug 29, 2021
1 parent 50bcb68 commit 46fa8f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/dns/nameserver_doh.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ func (s *DoHNameServer) findIPsForDomain(domain string, option dns_feature.IPOpt
return nil, err6
}

if (option.IPv4Enable && record.A != nil) || (option.IPv6Enable && record.AAAA != nil) {
return nil, dns_feature.ErrEmptyResponse
}

return nil, errRecordNotFound
}

Expand Down
4 changes: 4 additions & 0 deletions app/dns/nameserver_quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ func (s *QUICNameServer) findIPsForDomain(domain string, option dns_feature.IPOp
return nil, err6
}

if (option.IPv4Enable && record.A != nil) || (option.IPv6Enable && record.AAAA != nil) {
return nil, dns_feature.ErrEmptyResponse
}

return nil, errRecordNotFound
}

Expand Down

0 comments on commit 46fa8f7

Please sign in to comment.