windows: the kill switch holds to AmneziaWG tunnels already up when the service starts
From the security review of aa44527: a profile turned on by hand keeps its
tunnel (a Windows service of its own) running across a restart of this
service, but only autostart profiles were wanted on at start: such a
tunnel fell out of the kill switch. Running ones count at start too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aa44527082
commit
29304452f7
1 file changed
+4
-1
@@ -260,8 +260,11 @@ impl Service {
|
||||
let cfg = self.cfg().clone();
|
||||
let boot = !self.awg_vpn_started;
|
||||
self.awg_vpn_started = true;
|
||||
// At start: the autostart profiles, and any tunnel already up (turned on before this
|
||||
// service restarted: an update, a crash), are wanted on.
|
||||
if boot {
|
||||
self.awg_wanted.extend(crate::awgvpn::profiles(&cfg).into_iter().filter(|v| v.autostart).map(|v| v.iface));
|
||||
let running = |iface: &str| matches!(crate::awgvpn::state(iface).as_str(), "active" | "activating");
|
||||
self.awg_wanted.extend(crate::awgvpn::profiles(&cfg).into_iter().filter(|v| v.autostart || running(&v.iface)).map(|v| v.iface));
|
||||
}
|
||||
if !cfg!(windows) {
|
||||
if !crate::awgvpn::profiles(&cfg).is_empty() {
|
||||
|
||||
Reference in new issue
Block a user