Stop TUN and delete rules when the TUN button is untoggled

This commit is contained in:
Valeriy Manzhos 2026-04-09 17:20:21 +03:00
parent 4b52b06f6d
commit e7afe3bb92
No known key found for this signature in database
GPG key ID: 6547CFC8E2EC3D90

View file

@ -494,6 +494,15 @@ public class StatusBarViewModel : MyReactiveObject
}
}
}
if (EnableTun == false)
{
if (Utils.IsLinux())
{
await CoreManager.DeleteTUNRoutes();
await CoreManager.KillTUNProcess();
}
}
await ConfigHandler.SaveConfig(_config);
// On Linux TUN is managed by an external program, not by the core
if (!Utils.IsLinux())