Repository navigation
TUN inbound: Start on Windows when IPv6 is disabled system-wide - #6874
Merged
Merged
Conversation
With IPv6 turned off for the whole system, a new Wintun adapter gets no IPv6 interface, so luid.IPInterface(AF_INET6) returns ERROR_NOT_FOUND and the inbound fails with "failed to start proxy > Element not found." even when the config has no IPv6 gateway or route. Skip the IPv6 family in that case. A config that asks for IPv6 still fails as before.
|
REAL |
|
my ai agent said
I confirmed it by calling the Win32 API directly on a freshly created wintun adapter. CreateAdapter, StartSession and GetIpInterfaceEntry(AF_INET) succeed. GetIpInterfaceEntry(AF_INET6) returns 1168. sing-tun Expected |
patterniha
approved these changes
Oct 5, 2026
LjhAUMEM
approved these changes
Oct 5, 2026
Member
|
|
fanymagnet
pushed a commit
to fanymagnet/Xray-core
that referenced
this pull request
Oct 8, 2026
5 tasks done
patterniha
added a commit
to patterniha/PattN
that referenced
this pull request
Oct 20, 2026
Where the OS keeps IPv6 off on new interfaces (Windows with the DisabledComponents bit 0x10, which 0xFF includes, from the next restart; Linux with net.ipv6.conf.default.disable_ipv6 set or without the IPv6 stack), a TUN asked for an IPv6 address or route does not start: Xray-core leaves IPv6 out only when the config asks for none (XTLS/Xray-core#6874). "Enable IPv6 Address" then counts for nothing, so the Xray and sing-box TUNs get no IPv6 address, and sing-box's fake-IP server no IPv6 range. A global IPv6 address that an interface made earlier still holds would bypass such a TUN. Outside Windows strict route, where misconfigtun blocks it, the TUN then keeps asking for IPv6 as before, and fails to start rather than let that IPv6 out. The check reads the OS settings rather than the interfaces, so a host that is not connected yet still counts as having IPv6. Co-Authored-By: Claude Opus 5.5 <[email protected]>
patterniha
added a commit
that referenced
this pull request
Oct 29, 2026
…nt changes in README Covers #7173 (a connection that cannot be bound fails instead of leaving unbound), #7214 (IPv4-only and IPv6-only outbound interfaces on Windows), #7230 (IPV6_BOUND_IF on macOS), and also #7130 (built-in TCP/IP stack), #6874 (IPv6 disabled system-wide on Windows), #6811 (an existing Wintun adapter is reused) and #6883 (the iOS fd is duplicated). #7092 and autoSystemWfpBlockLeak were already covered. Co-Authored-By: Claude Opus 5.5 <[email protected]>
patterniha
added a commit
that referenced
this pull request
Nov 7, 2026
…onents` turns IPv6 off, with "misconfigtun" blocking IPv6 then #7341 (comment) IPv6 entries are no longer left out. With IPv6 turned off by DisabledComponents (0x10, the non-tunnel interfaces, the TUN among them, as in 0xFF), IPv6 is set up as usual, and errors doing so, clearing its DNS servers included, are only logged; otherwise they exit, also for a config without IPv6 entries, which replaces the skips of #6874, #7325 and #7332. "misconfigtun" then blocks IPv6 outside the TUN whatever the routes, as IPv6 still works until the reboot that applies the value. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RPRX
pushed a commit
that referenced
this pull request
Nov 8, 2026
… `DisabledComponents` turns IPv6 off, with "misconfigtun" blocking IPv6 then (#7341) #7325 (comment) #7332 (comment) #7341 (comment) Replaces #7332, #7325 and #6874 --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
RPRX
pushed a commit
that referenced
this pull request
Nov 8, 2026
…outingTable`) instead of exiting on Windows when `DisabledComponents` turns IPv6 off, with `autoSystemWfpBlockLeak`'s "misconfigtun" blocking IPv6 then (#7341) #7325 (comment) #7332 (comment) #7341 (comment) Replaces #7332, #7325 and #6874 --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows with IPv6 disabled system-wide, a freshly created Wintun adapter has no IPv6 interface.
Start()configures both address families unconditionally, sot.luid.IPInterface(windows.AF_INET6)returnsERROR_NOT_FOUNDand the inbound fails, even though the config has no IPv6 gateway or route:This change skips the IPv6 family when its interface does not exist and nothing in the config needs it (
gatewayandautoSystemRoutingTableare IPv4-only). A config that asks for IPv6 still fails as before.Where it was seen: a Windows 11 machine with no IPv6 address on any adapter and only loopback entries in the IPv6 route table. Turning IPv6 off is common advice in "fix" guides, so such systems are not rare.
Config used:
"gateway": ["172.19.0.1/30"],"autoSystemRoutingTable": ["0.0.0.0/0"],"autoOutboundsInterface": "auto".Testing: on that machine v26.9.9 failed on every start; v26.9.9 with this patch starts and carries traffic. On
mainI only checked that it builds and passesgo vetfor windows/amd64.