From 1e08d48d882bf871833f5bdb509152ebd800242d Mon Sep 17 00:00:00 2001 From: nSQUICK <87062921+nSQUICK@users.noreply.github.com> Date: Mon, 5 Oct 2026 11:26:00 +0400 Subject: [PATCH] TUN inbound: Start on Windows when IPv6 is disabled system-wide (#6874) https://github.com/XTLS/Xray-core/pull/6874#issuecomment-5989986544 --- proxy/tun/tun_windows.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxy/tun/tun_windows.go b/proxy/tun/tun_windows.go index d0101c2f7..61106efe6 100644 --- a/proxy/tun/tun_windows.go +++ b/proxy/tun/tun_windows.go @@ -178,6 +178,11 @@ startOver: } ipif, err := t.luid.IPInterface(family) if err != nil { + // With IPv6 disabled system-wide (DisabledComponents), the adapter has no + // IPv6 interface at all. Skip the family unless the config asks for it. + if err == windows.ERROR_NOT_FOUND && family == windows.AF_INET6 && !address6 && !route6 { + continue + } return err } ipif.RouterDiscoveryBehavior = winipcfg.RouterDiscoveryDisabled