Windows ignores the binding of autoOutboundsInterface (IP_UNICAST_IF) when
the outbound interface has weak host send or forwarding on for an IP version
routed to the TUN: Xray's own connections then go into the TUN, from that
interface's address, and stall.
While the TUN runs, weak host send is turned off on that interface for those
IP versions, and turned on again when it stops or another interface takes
over. Forwarding, which Mobile Hotspot and Internet Connection Sharing need,
cannot be turned off without breaking them, so it is reported instead: the
TUN does not start while it is on, and an error is logged when it comes on
later.
Fixes https://github.com/XTLS/Xray-core/issues/6776
Reports the cause of https://github.com/XTLS/Xray-core/issues/6872
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Proxy: TUN: Enhance Darwin interface support.
- reduce number of actions done to create/configure the interface in the system
- assign synthetic static link-local ipv4/ipv6 addresses to the interface, that are required by the OS for the routing to work
- make tun_darwin_endpoint be implemented significantly more similar to tun_windows_enpoint, preparing them for potential unification
* Proxy: TUN: Unify Darwin/Windows endpoint, which are now extremely similar, into one GVisorEndpoint.
Making darwin/windows tun implement GVisorDevice with simple readpacket/writepacket methods that GVisorEndpoint untilise
* Proxy: Implement tun raw network interface inbound support for Linux
* Proxy: Tun. Include "android" as build condition for build of tun_default implementation
* Proxy: Tun. Add .Close() cleanup calls to Handler.Init() where needed
* Proxy: Add Tun for Android
* Proxy: Tun. Implement Windows support
---------
Co-authored-by: yuhan6665 <1588741+yuhan6665@users.noreply.github.com>