TUN inbound: Warn about forwarding on the outbound interface instead of refusing to start

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>
This commit is contained in:
patterniha
2026-10-05 16:12:47 +03:30
co-authored by Claude Opus 5.5
parent b71975abed
commit 46d49adc5c
3 changed files with 6 additions and 8 deletions
+1 -3
View File
@@ -307,9 +307,7 @@ startOver:
if route6 {
t.guard.families = append(t.guard.families, windows.AF_INET6)
}
if problem := t.guard.check(); problem != "" {
return errors.New(problem)
}
t.guard.recheck()
// Only a registered callback goes into the fields: a nil pointer in
// them would not compare equal to nil in Close.
cbr, err := winipcfg.RegisterRouteChangeCallback(func(notificationType winipcfg.MibNotificationType, route *winipcfg.MibIPforwardRow2) {