Chore: global ipv6 could affect dns ipv6

This commit is contained in:
Dreamacro 2023-07-22 17:35:12 +08:00
parent c7e34bdc11
commit 07ed6e8bef
1 changed files with 2 additions and 2 deletions

View File

@ -107,7 +107,7 @@ type Config struct {
type RawDNS struct { type RawDNS struct {
Enable bool `yaml:"enable"` Enable bool `yaml:"enable"`
IPv6 bool `yaml:"ipv6"` IPv6 *bool `yaml:"ipv6"`
UseHosts bool `yaml:"use-hosts"` UseHosts bool `yaml:"use-hosts"`
NameServer []string `yaml:"nameserver"` NameServer []string `yaml:"nameserver"`
Fallback []string `yaml:"fallback"` Fallback []string `yaml:"fallback"`
@ -632,7 +632,7 @@ func parseDNS(rawCfg *RawConfig, hosts *trie.DomainTrie) (*DNS, error) {
dnsCfg := &DNS{ dnsCfg := &DNS{
Enable: cfg.Enable, Enable: cfg.Enable,
Listen: cfg.Listen, Listen: cfg.Listen,
IPv6: cfg.IPv6, IPv6: lo.FromPtrOr(cfg.IPv6, rawCfg.IPv6),
EnhancedMode: cfg.EnhancedMode, EnhancedMode: cfg.EnhancedMode,
FallbackFilter: FallbackFilter{ FallbackFilter: FallbackFilter{
IPCIDR: []*net.IPNet{}, IPCIDR: []*net.IPNet{},