[PR #3021] fix(windows): batch exclusion route updates #3058

Open
opened 2026-10-14 21:07:13 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/3021
Author: @ShiroKSH
Created: 8/22/2026
Status: 🔄 Open

Base: dev ← Head: fix/windows-batch-exclusion-routes


📝 Commits (1)

  • 4814da9 fix(windows): batch exclusion route updates

📊 Changes

7 files changed (+167 additions, -87 deletions)

View changed files

📝 client/daemon/daemon.cpp (+28 -14)
📝 client/daemon/daemon.h (+1 -1)
📝 client/daemon/wireguardutils.h (+11 -0)
📝 client/platforms/windows/daemon/windowsroutemonitor.cpp (+109 -63)
📝 client/platforms/windows/daemon/windowsroutemonitor.h (+6 -1)
📝 client/platforms/windows/daemon/wireguardutilswindows.cpp (+10 -8)
📝 client/platforms/windows/daemon/wireguardutilswindows.h (+2 -0)

📄 Description

Summary

  • batch excluded-address route installation across daemon and Windows routing layers
  • preserve per-prefix success tracking and exclusion reference counts
  • filter VPN and self-created routes once before reconciling exclusion routes

Why

The Windows route monitor fetched and scanned the full routing table once for every excluded CIDR. Each inserted route enlarged the next snapshot, making connection setup quadratic for large split-routing lists. Route-change reconciliation repeated the same scan across all self-created routes.

The new batch path takes one route-table and interface-metric snapshot, reuses the physical route candidates for every exclusion, and exposes the complete batch before captured-route reconciliation.

Verification

  • git diff --check
  • focused call-path inspection confirms one GetIpForwardTable2(AF_UNSPEC, ...) and one updateInterfaceMetrics(AF_UNSPEC) per exclusion batch
  • operation-count model for 12,840 exclusions and 35 baseline routes: connection row visits drop from 82,875,780 to 449,435; route-change visits drop from 165,315,000 to 462,275

Fixes #3020


🔄 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/3021 **Author:** [@ShiroKSH](https://github.com/ShiroKSH) **Created:** 8/22/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/windows-batch-exclusion-routes` --- ### 📝 Commits (1) - [`4814da9`](https://github.com/amnezia-vpn/amnezia-client/commit/4814da9e1bc32f2f0fb6767616bca601e9b56902) fix(windows): batch exclusion route updates ### 📊 Changes **7 files changed** (+167 additions, -87 deletions) <details> <summary>View changed files</summary> 📝 `client/daemon/daemon.cpp` (+28 -14) 📝 `client/daemon/daemon.h` (+1 -1) 📝 `client/daemon/wireguardutils.h` (+11 -0) 📝 `client/platforms/windows/daemon/windowsroutemonitor.cpp` (+109 -63) 📝 `client/platforms/windows/daemon/windowsroutemonitor.h` (+6 -1) 📝 `client/platforms/windows/daemon/wireguardutilswindows.cpp` (+10 -8) 📝 `client/platforms/windows/daemon/wireguardutilswindows.h` (+2 -0) </details> ### 📄 Description ## Summary - batch excluded-address route installation across daemon and Windows routing layers - preserve per-prefix success tracking and exclusion reference counts - filter VPN and self-created routes once before reconciling exclusion routes ## Why The Windows route monitor fetched and scanned the full routing table once for every excluded CIDR. Each inserted route enlarged the next snapshot, making connection setup quadratic for large split-routing lists. Route-change reconciliation repeated the same scan across all self-created routes. The new batch path takes one route-table and interface-metric snapshot, reuses the physical route candidates for every exclusion, and exposes the complete batch before captured-route reconciliation. ## Verification - `git diff --check` - focused call-path inspection confirms one `GetIpForwardTable2(AF_UNSPEC, ...)` and one `updateInterfaceMetrics(AF_UNSPEC)` per exclusion batch - operation-count model for 12,840 exclusions and 35 baseline routes: connection row visits drop from 82,875,780 to 449,435; route-change visits drop from 165,315,000 to 462,275 Fixes #3020 --- <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#3058
No description provided.