[PR #3231] fix: handle large Linux route dumps #3140

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

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/3231
Author: @ansalim01
Created: 9/28/2026
Status: 🔄 Open

Base: dev ← Head: fix-linux-route-dump


📝 Commits (1)

  • 8301cd0 fix: handle large Linux route dumps

📊 Changes

4 files changed (+135 additions, -69 deletions)

View changed files

📝 client/core/utils/networkUtilities.cpp (+69 -60)
📝 client/platforms/linux/daemon/wireguardutilslinux.cpp (+30 -9)
📝 client/tests/CMakeLists.txt (+10 -0)
➕ client/tests/testNetworkUtilities.cpp (+26 -0)

📄 Description

Summary

  • read multipart Linux route dumps without overflowing the original 8 KiB buffer
  • select only the IPv4 default route from matching netlink responses
  • skip empty WireGuard endpoint addresses and fail activation when endpoint exclusion cannot be installed
  • add a Linux regression test for default-gateway discovery

Root cause

On systems with a larger routing table, such as Ubuntu 24.04 with container or bridge routes, the RTM_GETROUTE dump exceeded the fixed 8192-byte buffer. The receive loop then failed before parsing the existing default route. LinuxRouteMonitor consequently skipped the VPN endpoint exclusion route, after which the /1 full-tunnel routes sent the WireGuard transport back into amn0.

An empty IPv6 endpoint was also passed to IPAddress, producing the unrelated /999999 warning.

Validation

  • reproduced with AmneziaVPN 5.0.3.0 / amnezia-awg2 on Ubuntu 24.04
  • regression test passed on Ubuntu 24.04 with 300 additional routes, making the dump larger than the original 8 KiB buffer
  • git diff --check passes
  • verified that the broad routing implementation remains unchanged; this is a focused hotfix

🔄 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/3231 **Author:** [@ansalim01](https://github.com/ansalim01) **Created:** 9/28/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix-linux-route-dump` --- ### 📝 Commits (1) - [`8301cd0`](https://github.com/amnezia-vpn/amnezia-client/commit/8301cd025d77af8ba9cf083fac3c6fdac218b242) fix: handle large Linux route dumps ### 📊 Changes **4 files changed** (+135 additions, -69 deletions) <details> <summary>View changed files</summary> 📝 `client/core/utils/networkUtilities.cpp` (+69 -60) 📝 `client/platforms/linux/daemon/wireguardutilslinux.cpp` (+30 -9) 📝 `client/tests/CMakeLists.txt` (+10 -0) ➕ `client/tests/testNetworkUtilities.cpp` (+26 -0) </details> ### 📄 Description ## Summary - read multipart Linux route dumps without overflowing the original 8 KiB buffer - select only the IPv4 default route from matching netlink responses - skip empty WireGuard endpoint addresses and fail activation when endpoint exclusion cannot be installed - add a Linux regression test for default-gateway discovery ## Root cause On systems with a larger routing table, such as Ubuntu 24.04 with container or bridge routes, the `RTM_GETROUTE` dump exceeded the fixed 8192-byte buffer. The receive loop then failed before parsing the existing default route. `LinuxRouteMonitor` consequently skipped the VPN endpoint exclusion route, after which the `/1` full-tunnel routes sent the WireGuard transport back into `amn0`. An empty IPv6 endpoint was also passed to `IPAddress`, producing the unrelated `/999999` warning. ## Validation - reproduced with AmneziaVPN 5.0.3.0 / `amnezia-awg2` on Ubuntu 24.04 - regression test passed on Ubuntu 24.04 with 300 additional routes, making the dump larger than the original 8 KiB buffer - `git diff --check` passes - verified that the broad routing implementation remains unchanged; this is a focused hotfix --- <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#3140
No description provided.