As asked in review: switching between two interfaces with forwarding on now
warns about the new one, and an IPInterface failure while restoring weak
host send is logged, with the interface's name, instead of ignored.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since the TUN starts with forwarding on the outbound interface too, check
is only called through recheck, so they are one function now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mobile Hotspot may well be on before the TUN starts, and having it share
the TUN instead of the physical interface then moves forwarding off it, but
the TUN can only be picked to share while it runs. So the TUN starts, with a
warning that says so, and Xray's own connections recover once forwarding
goes off.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows turns forwarding on and off a few times while Mobile Hotspot starts,
so the error is logged when forwarding comes up, not on every change, and
turning weak host send off is logged once per IP version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>