[PR #3408] fix(windows): fail WireGuard activation when the kill switch cannot be enabled #3285

Open
opened 2026-11-07 17:58:57 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/3408
Author: @OverFitted
Created: 11/5/2026
Status: 🔄 Open

Base: dev ← Head: fix/windows-killswitch-errors


📝 Commits (1)

  • 61c0df5 fix(windows): fail WireGuard activation when the kill switch cannot be enabled

📊 Changes

1 file changed (+8 additions, -2 deletions)

View changed files

📝 client/platforms/windows/daemon/wireguardutilswindows.cpp (+8 -2)

📄 Description

Summary

Stop a WireGuard/AmneziaWG connection on Windows from reporting Connected when the kill switch could not be set up.

Problem

WireguardUtilsWindows::addInterface() ignores the result of WindowsFirewall::enableInterface(), and updatePeer() ignores the result of WindowsFirewall::enablePeerTraffic().

When any FwpmFilterAdd0 call inside enablePeerTraffic() fails (for example with a long split tunneling list), its scope guard aborts the transaction and calls disableKillSwitch(). In the default mode that removes every filter, yet activation continues and the client shows Connected with the kill switch enabled in settings while no filters are installed.

Changes

  • Return false from addInterface() and updatePeer() when the firewall call fails, with an error in the log.

Daemon::activate() already handles a false from both methods (it is the path a failed route takes), and WindowsDaemon disables the kill switch on activationFailure, so the user gets a failed connection instead of an unprotected one.

Backward compatibility

Nothing changes when the firewall calls succeed or when the kill switch is off.

Verification

  • Built the Windows x64 client, service and tests in Release mode (MSVC 19.35, Qt 6.10.1) against dev at ac175c8; ctest passes.
  • Checked that both firewall methods return false only on WFP API errors: an empty IPv6 gateway becomes a valid :: filter, so there is no new failure for configs that connect today.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amnezia-vpn/amnezia-client/pull/3408 **Author:** [@OverFitted](https://github.com/OverFitted) **Created:** 11/5/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/windows-killswitch-errors` --- ### 📝 Commits (1) - [`61c0df5`](https://github.com/amnezia-vpn/amnezia-client/commit/61c0df5d9f8ceb32bff8a2132cdab267bd2abd19) fix(windows): fail WireGuard activation when the kill switch cannot be enabled ### 📊 Changes **1 file changed** (+8 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `client/platforms/windows/daemon/wireguardutilswindows.cpp` (+8 -2) </details> ### 📄 Description ## Summary Stop a WireGuard/AmneziaWG connection on Windows from reporting *Connected* when the kill switch could not be set up. ## Problem `WireguardUtilsWindows::addInterface()` ignores the result of `WindowsFirewall::enableInterface()`, and `updatePeer()` ignores the result of `WindowsFirewall::enablePeerTraffic()`. When any `FwpmFilterAdd0` call inside `enablePeerTraffic()` fails (for example with a long split tunneling list), its scope guard aborts the transaction and calls `disableKillSwitch()`. In the default mode that removes every filter, yet activation continues and the client shows *Connected* with the kill switch enabled in settings while no filters are installed. ## Changes - Return `false` from `addInterface()` and `updatePeer()` when the firewall call fails, with an error in the log. `Daemon::activate()` already handles a `false` from both methods (it is the path a failed route takes), and `WindowsDaemon` disables the kill switch on `activationFailure`, so the user gets a failed connection instead of an unprotected one. ## Backward compatibility Nothing changes when the firewall calls succeed or when the kill switch is off. ## Verification - Built the Windows x64 client, service and tests in Release mode (MSVC 19.35, Qt 6.10.1) against `dev` at ac175c8; `ctest` passes. - Checked that both firewall methods return `false` only on WFP API errors: an empty IPv6 gateway becomes a valid `::` filter, so there is no new failure for configs that connect today. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#3285
No description provided.