Skip to content

Commit c06d7f0

Browse files
committed
Fix render fake-ip
1 parent b1c0882 commit c06d7f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

template/render_dns.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ func (t *Template) renderDNS(metadata M.Metadata, options *option.Options) error
9898
options.DNS.FakeIP = &option.DNSFakeIPOptions{}
9999
}
100100
options.DNS.FakeIP.Enabled = true
101-
if !options.DNS.FakeIP.Inet4Range.IsValid() {
101+
if options.DNS.FakeIP.Inet4Range == nil || !options.DNS.FakeIP.Inet4Range.IsValid() {
102102
options.DNS.FakeIP.Inet4Range = common.Ptr(netip.MustParsePrefix("198.18.0.0/15"))
103103
}
104-
if !t.DisableIPv6() && !options.DNS.FakeIP.Inet6Range.IsValid() {
104+
if !t.DisableIPv6() && options.DNS.FakeIP.Inet6Range == nil || !options.DNS.FakeIP.Inet6Range.IsValid() {
105105
options.DNS.FakeIP.Inet6Range = common.Ptr(netip.MustParsePrefix("fc00::/18"))
106106
}
107107
options.DNS.Servers = append(options.DNS.Servers, option.DNSServerOptions{

0 commit comments

Comments
 (0)