From 07ed6e8bef51f95e7884773613b1d887bcad3e50 Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Sat, 22 Jul 2023 17:35:12 +0800 Subject: [PATCH] Chore: global ipv6 could affect dns ipv6 --- config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index e9697d4..09183e6 100644 --- a/config/config.go +++ b/config/config.go @@ -107,7 +107,7 @@ type Config struct { type RawDNS struct { Enable bool `yaml:"enable"` - IPv6 bool `yaml:"ipv6"` + IPv6 *bool `yaml:"ipv6"` UseHosts bool `yaml:"use-hosts"` NameServer []string `yaml:"nameserver"` Fallback []string `yaml:"fallback"` @@ -632,7 +632,7 @@ func parseDNS(rawCfg *RawConfig, hosts *trie.DomainTrie) (*DNS, error) { dnsCfg := &DNS{ Enable: cfg.Enable, Listen: cfg.Listen, - IPv6: cfg.IPv6, + IPv6: lo.FromPtrOr(cfg.IPv6, rawCfg.IPv6), EnhancedMode: cfg.EnhancedMode, FallbackFilter: FallbackFilter{ IPCIDR: []*net.IPNet{},