fix: dns empty response

This commit is contained in:
Zeyu Chen 2023-04-26 22:35:12 +08:00 committed by yuhan6665
parent ae518cce52
commit bfd5da2f00
4 changed files with 22 additions and 3 deletions

View file

@ -8,6 +8,7 @@ import (
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/buf"
"github.com/xtls/xray-core/common/errors"
"github.com/xtls/xray-core/common/net"
dns_proto "github.com/xtls/xray-core/common/protocol/dns"
"github.com/xtls/xray-core/common/session"
@ -232,7 +233,7 @@ func (h *Handler) handleIPQuery(id uint16, qType dnsmessage.Type, domain string,
}
rcode := dns.RCodeFromError(err)
if rcode == 0 && len(ips) == 0 && err != dns.ErrEmptyResponse {
if rcode == 0 && len(ips) == 0 && !errors.AllEqual(dns.ErrEmptyResponse, errors.Cause(err)) {
newError("ip query").Base(err).WriteToLog()
return
}