mirror of
https://github.com/2dust/v2rayN.git
synced 2026-09-27 09:23:26 +03:00
Follow-up to #9830: audit of all TunModeItem.EnableTun usages found three more launch-path reads of the live mutable config where the behavior must agree with the context snapshot that generated the config: - CoreConfigClashService (mihomo custom config): the tun section was decided from the live config while the mihomo launch elevation uses the snapshot; a mid-reload toggle could produce a config containing tun launched without sudo, the same failure fixed in #9830. The tun state is now passed in as a snapshot. - CoreManager.LoadCore: the Windows RemoveTunDevice cleanup now checks the main/pre context snapshots. - CoreManager.WaitForProxyPort: preContext.AppConfig is a shared live reference; use preContext.IsTunEnabled instead. Reads that intentionally stay live: StatusBarViewModel (UI state source), CoreConfigContextBuilder (the snapshot capture point), GetPreSocksItem (called during snapshot construction, self-consistent), and AppManager.StatePort2 (transient mid-reload skew only, self-heals after reload).