From f837a6fdc84a98d1582f913b341b66bb3a6c68ec Mon Sep 17 00:00:00 2001 From: naiba Date: Mon, 29 Jul 2024 10:10:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ipv6=20=E5=8D=95=E6=A0=88=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E4=B8=8A=E6=8A=A5=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/monitor/myip.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/monitor/myip.go b/pkg/monitor/myip.go index 64b6c31..e72180b 100644 --- a/pkg/monitor/myip.go +++ b/pkg/monitor/myip.go @@ -45,7 +45,7 @@ func UpdateIP(useIPv6CountryCode bool, period uint32) { CachedIP = fmt.Sprintf("%s/%s", ipv4, ipv6) } - if ipv6 != "" && useIPv6CountryCode { + if ipv6 != "" && (useIPv6CountryCode || ipv4 == "") { GeoQueryIP = ipv6 } else { GeoQueryIP = ipv4