[PR #2805] [CLOSED] Fix AllowedIPs parsing when comma is not followed by space #2955

Closed
opened 2026-10-14 21:06:28 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/2805
Author: @rootcreep
Created: 7/5/2026
Status: ❌ Closed

Base: dev ← Head: fix/allowed-ips-parsing


📝 Commits (1)

  • c4500e0 Fix AllowedIPs parsing when comma is not followed by space.

📊 Changes

5 files changed (+78 additions, -16 deletions)

View changed files

📝 client/core/controllers/selfhosted/importController.cpp (+1 -1)
📝 client/core/protocols/protocolUtils.cpp (+59 -0)
📝 client/core/protocols/protocolUtils.h (+5 -0)
📝 client/ui/controllers/serversUiController.cpp (+3 -11)
📝 client/vpnConnection.cpp (+10 -4)

📄 Description

Summary

  • Add ProtocolUtils::parseAllowedIps() to split AllowedIPs by comma with optional whitespace, matching WireGuard config format.
  • Use the new parser when importing WireGuard configs and when reading AllowedIPs from native config at connection time.
  • Replace fragile string comparison for server-side split tunneling detection with parsed AllowedIPs checks, including normalization of legacy malformed entries.

Problem

When a WireGuard/AWG config contains AllowedIPs = 0.0.0.0/0,::/0 (no space after comma), the client split the value only on ", ". This produced a single entry "0.0.0.0/0,::/0" instead of two separate routes, causing the app to incorrectly treat full-tunnel servers as having server-side split tunneling and show "Default server does not support split tunneling function".

Test plan

  • Import a WireGuard config with AllowedIPs = 0.0.0.0/0,::/0 (no space after comma) and verify split tunneling settings page opens without error.
  • Import a config with AllowedIPs = 0.0.0.0/0, ::/0 (with space) and verify behavior is unchanged.
  • Import a config with custom AllowedIPs (e.g. 10.0.0.0/8,192.168.0.0/16) and verify server-side split tunneling is still detected correctly.
  • Connect to a full-tunnel WireGuard/AWG server and verify client-side site split tunneling works when enabled.

Made with Cursor


🔄 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/2805 **Author:** [@rootcreep](https://github.com/rootcreep) **Created:** 7/5/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/allowed-ips-parsing` --- ### 📝 Commits (1) - [`c4500e0`](https://github.com/amnezia-vpn/amnezia-client/commit/c4500e07b5e0e65b43a8ce4921d218a34f796229) Fix AllowedIPs parsing when comma is not followed by space. ### 📊 Changes **5 files changed** (+78 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `client/core/controllers/selfhosted/importController.cpp` (+1 -1) 📝 `client/core/protocols/protocolUtils.cpp` (+59 -0) 📝 `client/core/protocols/protocolUtils.h` (+5 -0) 📝 `client/ui/controllers/serversUiController.cpp` (+3 -11) 📝 `client/vpnConnection.cpp` (+10 -4) </details> ### 📄 Description ## Summary - Add `ProtocolUtils::parseAllowedIps()` to split AllowedIPs by comma with optional whitespace, matching WireGuard config format. - Use the new parser when importing WireGuard configs and when reading AllowedIPs from native config at connection time. - Replace fragile string comparison for server-side split tunneling detection with parsed AllowedIPs checks, including normalization of legacy malformed entries. ## Problem When a WireGuard/AWG config contains `AllowedIPs = 0.0.0.0/0,::/0` (no space after comma), the client split the value only on `", "`. This produced a single entry `"0.0.0.0/0,::/0"` instead of two separate routes, causing the app to incorrectly treat full-tunnel servers as having server-side split tunneling and show "Default server does not support split tunneling function". ## Test plan - [ ] Import a WireGuard config with `AllowedIPs = 0.0.0.0/0,::/0` (no space after comma) and verify split tunneling settings page opens without error. - [ ] Import a config with `AllowedIPs = 0.0.0.0/0, ::/0` (with space) and verify behavior is unchanged. - [ ] Import a config with custom AllowedIPs (e.g. `10.0.0.0/8,192.168.0.0/16`) and verify server-side split tunneling is still detected correctly. - [ ] Connect to a full-tunnel WireGuard/AWG server and verify client-side site split tunneling works when enabled. Made with [Cursor](https://cursor.com) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-14 21:06:28 +00:00
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#2955
No description provided.