mirror of https://github.com/Dreamacro/clash.git
Fix: should check all ips need to fallback (#2915)
This commit is contained in:
parent
1855e18734
commit
db2b5db2c6
|
@ -265,7 +265,10 @@ func (r *Resolver) ipExchange(ctx context.Context, m *D.Msg) (msg *D.Msg, err er
|
|||
res := <-msgCh
|
||||
if res.Error == nil {
|
||||
if ips := msgToIP(res.Msg); len(ips) != 0 {
|
||||
if !r.shouldIPFallback(ips[0]) {
|
||||
shouldNotFallback := lo.EveryBy(ips, func(ip net.IP) bool {
|
||||
return !r.shouldIPFallback(ip)
|
||||
})
|
||||
if shouldNotFallback {
|
||||
msg = res.Msg // no need to wait for fallback result
|
||||
err = res.Error
|
||||
return msg, err
|
||||
|
|
Loading…
Reference in New Issue