1
0
mirror of https://github.com/MetaCubeX/mihomo.git synced 2025-09-19 12:06:01 +08:00

chore: allow tun to skip the system ipv6 check when starting by environment variable SKIP_SYSTEM_IPV6_CHECK

This commit is contained in:
wwqgtxx
2025-06-14 15:57:54 +08:00
parent ebf5918e94
commit c60750d549

View File

@ -4,6 +4,8 @@ import (
"fmt"
"net"
"net/netip"
"os"
"strconv"
"strings"
"github.com/metacubex/mihomo/adapter/outboundgroup"
@ -150,6 +152,9 @@ func proxyGroupsDagSort(groupsConfig []map[string]any) error {
}
func verifyIP6() bool {
if skip, _ := strconv.ParseBool(os.Getenv("SKIP_SYSTEM_IPV6_CHECK")); skip {
return true
}
if iAddrs, err := net.InterfaceAddrs(); err == nil {
for _, addr := range iAddrs {
if prefix, err := netip.ParsePrefix(addr.String()); err == nil {