Fix fakeip lookup
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"net/netip"
|
||||
|
||||
"github.com/sagernet/sing-box/adapter"
|
||||
"github.com/sagernet/sing-dns"
|
||||
E "github.com/sagernet/sing/common/exceptions"
|
||||
"github.com/sagernet/sing/common/logger"
|
||||
)
|
||||
@@ -72,9 +71,12 @@ func (s *Store) Close() error {
|
||||
})
|
||||
}
|
||||
|
||||
func (s *Store) Create(domain string, strategy dns.DomainStrategy) (netip.Addr, error) {
|
||||
func (s *Store) Create(domain string, isIPv6 bool) (netip.Addr, error) {
|
||||
if address, loaded := s.storage.FakeIPLoadDomain(domain, isIPv6); loaded {
|
||||
return address, nil
|
||||
}
|
||||
var address netip.Addr
|
||||
if strategy == dns.DomainStrategyUseIPv4 {
|
||||
if !isIPv6 {
|
||||
if !s.inet4Current.IsValid() {
|
||||
return netip.Addr{}, E.New("missing IPv4 fakeip address range")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user