windows: the kill switch

Upstream's killSwitch, on the Windows Filtering Platform: while the TUN or a
system-wide AmneziaWG profile is on, connections that would leave past it are
blocked at the ALE connect layers, while the tunnel runs, restarts or has
failed. Open: loopback, the private and reserved networks with
allowedSubnets, what leaves from the tunnels' own addresses, the tunnel's own
programs (the backend, its helpers, awg-tunnel; the service with
directFallbacks), NTP with allowTimeSync. Turning a tunnel off, or
proxy-ctl killswitch off / the Overview's Lift, lifts it until a tunnel is
turned on again.

The filters live in a dynamic WFP session of the service's: they go with
it, so stopping the service always gets the network back. Upstream holds
from boot; that needs persistent filters, for once these are seen to work
on real Windows (Wine has no WFP). A changed plan goes in under the other of
two sublayers before the old one goes, so nothing leaks between.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Opus 5.5 committed 2026-10-28 00:17:24 +03:00
1 parent ddc1bbe686
commit 32ff264c81
12 files changed
+557 -9

No files matched your search

+6
View File
@@ -108,6 +108,12 @@ pub enum Request {
#[serde(default)]
probe: bool,
},
/// The kill switch: lift it (`on: false`, until a tunnel is turned on), hold it again
/// (`true`), or (none) what it does.
KillSwitch {
#[serde(default)]
on: Option<bool>,
},
/// This version, and the newest release if it is newer.
UpdateCheck,
/// Fetches the newest release's setup program, checks it, and runs it: the service stops,