Repository navigation
macOS: default-interface monitor stays on removed USB tether after Wi-Fi handoff #3345
grinkevichegor
started this conversation in
General
Replies: 1 comment
|
Update (2026-10-24): I reproduced a stale outbound selection with the current official Mihomo Alpha |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Environment
88dcbf7);github.com/metacubex/sing-tunv0.4.27auto-routeandauto-detect-interface; no fixed outbound interfaceObservation
On one iPhone hotspot, USB (
en7) works with TUN, mixed proxy and direct HTTPS. After joining the same hotspot by Wi-Fi, macOS usesen0as its physical default anden7goes inactive. New physical HTTPS succeeds, while new mixed-proxy and system-TUN HTTPS time out. Outbound dials reportnetwork is unreachable; the core logged default interface=> en7but no subsequent=> en0before the stock trial ended. We also observed attempted dials retaining the disappeared USB source address. A TUN restart restores traffic, but is only a workaround.en7en0; mixed and TUN recovered after brief warm-upThe patched core was also installed as a local Clash Verge pilot. Both admin and ordinary configurations completed Wi-Fi → USB → Wi-Fi with TUN enabled. One ordinary run had a transient timeout followed by four consecutive successes. This supports repair of the persistent stale-interface failure, not lossless handoff.
Diagnostic candidate and limits
The attached sanitized source patch adds a Darwin-only 2-second recheck using the existing
postCheckUpdate()path, stops it onClose(), and tests rechecks without a route event. This is a diagnostic candidate; an event-driven repair or slower fallback may be preferable. One place worth examining isnetworkUpdateMonitor.loopUpdate0/loopUpdate1in sing-tun v0.4.27: it opens an AF_ROUTE socket, reads once, then closes and reopens it. Could a rapid handoff event fall between reads? This is a source-level hypothesis, not a proven cause.The isolated comparison used a privately copied application runtime. I have not yet reduced it to a standalone public DIRECT-only CLI configuration, tested latest Alpha, or collected complete DEBUG logs suitable for publication. I cannot prove whether macOS omitted a route event or the monitor missed it. Same-interface Wi-Fi IP/gateway changes, sleep/wake and other networks still need separate checks. No private profile, endpoint, address, capture or raw log is attached.
Could maintainers advise the preferred fix in sing-tun/Mihomo and whether a minimal DIRECT CLI reproduction would help? A related Clash Verge report is #7576; it has a different trigger and does not establish the same root cause.
Sanitized diagnostic source patch:
vpn082-sing-tun-poll.patch.txt
All reactions