[GH-ISSUE #3377] Windows site exclusions can be partially applied without failing tunnel activation #3238

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

Originally created by @makkoar on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3377

Describe the bug

I encountered CIDR entries remaining visible in my exclusion list while their destinations still used the VPN, together with slow or intermittent connections on a large Windows exclusion list.

This issue tracks the route-application layer separately from hostname resolution and WG/AWG AllowedIPs handling.

At dev 3f6ecacff15e0ada890f6cf5174602d2b6b899c5, Daemon::activate() and Daemon::switchServer() add excluded routes one at a time without checking the result. A failed route can therefore leave a partially installed list while activation continues. The route monitor also takes a fresh routing-table snapshot per prefix, and route notifications can repeatedly reconcile an expanding table.

Reproduction and evidence

  1. On Windows, use WG/AWG with site splitting in the all-sites-except-listed mode.
  2. Add IPv4/CIDR exclusions, connect, and compare the actual selected interface for excluded destinations with the configured list.
  3. A route-installation failure is the relevant failure condition: the current daemon ignores the return value instead of failing and undoing the additions.

The ignored return values and missing batch rollback are source-level findings. My earlier live observations establish incorrectly routed exclusions and slow setup, but I have not performed a fresh failure-injection run on current dev. The scaling reproduction with 12,840 prefixes is independently documented in #3020.

Expected behavior

  • Install an exclusion batch against a reusable physical-route snapshot.
  • Commit reference-count changes only after successful installation.
  • On activation/server-switch failure, roll back additions and report failure.
  • Preserve pre-existing routes that the monitor does not own.
  • Reconcile gateway/interface changes without repeated work for each route notification.
  • Remove only owned routes during cleanup.

Environment and scope

Windows x64, WireGuard/AmneziaWG, large IPv4 site-exclusion lists.

The existing combined implementation was built and tested on Windows before this split. A read-only check of my installed patched build found no VPN-selected route among 2,784 sampled addresses from 1,104 exclusions. This is not proof of every failure path, IPv6 configuration or application-based bypass.

The common daemon and the fallback batch API are also touched; Windows-specific route monitoring is the main implementation scope.

  • #2248: very slow Windows setup with large split-tunneling lists.
  • #3020: per-prefix routing-table work becomes quadratic. This issue also reports a crash whose exact cause is not established; I am not claiming that crash is proven fixed.
  • #3021: overlapping batch-route implementation.
  • #3375: separate AllowedIPs/site-allowlist failure.

Fix: #3030, now scoped to this route-application issue. Umbrella tracker: #3378. The sibling fixes are #3379 (AllowedIPs) and #3380 (hostnames/DNS).

Originally created by @makkoar on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3377 ## Describe the bug I encountered CIDR entries remaining visible in my exclusion list while their destinations still used the VPN, together with slow or intermittent connections on a large Windows exclusion list. This issue tracks the route-application layer separately from hostname resolution and WG/AWG AllowedIPs handling. At dev `3f6ecacff15e0ada890f6cf5174602d2b6b899c5`, `Daemon::activate()` and `Daemon::switchServer()` add excluded routes one at a time without checking the result. A failed route can therefore leave a partially installed list while activation continues. The route monitor also takes a fresh routing-table snapshot per prefix, and route notifications can repeatedly reconcile an expanding table. ## Reproduction and evidence 1. On Windows, use WG/AWG with site splitting in the all-sites-except-listed mode. 2. Add IPv4/CIDR exclusions, connect, and compare the actual selected interface for excluded destinations with the configured list. 3. A route-installation failure is the relevant failure condition: the current daemon ignores the return value instead of failing and undoing the additions. The ignored return values and missing batch rollback are source-level findings. My earlier live observations establish incorrectly routed exclusions and slow setup, but I have not performed a fresh failure-injection run on current dev. The scaling reproduction with 12,840 prefixes is independently documented in #3020. ## Expected behavior - Install an exclusion batch against a reusable physical-route snapshot. - Commit reference-count changes only after successful installation. - On activation/server-switch failure, roll back additions and report failure. - Preserve pre-existing routes that the monitor does not own. - Reconcile gateway/interface changes without repeated work for each route notification. - Remove only owned routes during cleanup. ## Environment and scope Windows x64, WireGuard/AmneziaWG, large IPv4 site-exclusion lists. The existing combined implementation was built and tested on Windows before this split. A read-only check of my installed patched build found no VPN-selected route among 2,784 sampled addresses from 1,104 exclusions. This is not proof of every failure path, IPv6 configuration or application-based bypass. The common daemon and the fallback batch API are also touched; Windows-specific route monitoring is the main implementation scope. ## Related issues and overlapping PRs - #2248: very slow Windows setup with large split-tunneling lists. - #3020: per-prefix routing-table work becomes quadratic. This issue also reports a crash whose exact cause is not established; I am not claiming that crash is proven fixed. - #3021: overlapping batch-route implementation. - #3375: separate AllowedIPs/site-allowlist failure. Fix: #3030, now scoped to this route-application issue. Umbrella tracker: #3378. The sibling fixes are #3379 (AllowedIPs) and #3380 (hostnames/DNS).
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#3238
No description provided.