mirror of
https://github.com/amnezia-vpn/amneziawg-apple.git
synced 2026-12-03 18:31:54 +07:00
[PR #53] feat(routing): add confirmed live rule updates for existing tunnels #53
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-apple#53
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/amnezia-vpn/amneziawg-apple/pull/53
Author: @ariran5
Created: 11/1/2026
Status: 🔄 Open
Base:
master← Head:feat/live-split-routing📝 Commits (1)
d63ac73feat(routing): add confirmed live rule updates for existing tunnels📊 Changes
10 files changed (+516 additions, -36 deletions)
View changed files
📝
Package.swift(+1 -0)➕
Sources/WireGuardKit/RoutingUpdatePlan.swift(+57 -0)➕
Sources/WireGuardKit/RoutingUpdateTransaction.swift(+69 -0)📝
Sources/WireGuardKit/WireGuardAdapter.swift(+82 -33)📝
Sources/WireGuardKitGo/api-apple.go(+7 -3)➕
Sources/WireGuardKitGo/api-apple_test.go(+81 -0)📝
Sources/WireGuardNetworkExtension/PacketTunnelProvider.swift(+4 -0)➕
Tests/WireGuardKitTests/RoutingUpdatePlanTests.swift(+103 -0)➕
Tests/WireGuardKitTests/RoutingUpdateTransactionTests.swift(+100 -0)📝
WireGuard.xcodeproj/project.pbxproj(+12 -0)📄 Description
The current adapter ignores
wgSetConfigfailures and continues after a missing network-settings completion. Its general update also emitsreplace_peers=true, so it cannot provide a confirmed, routing-only operation that preserves an existing peer.Add
WireGuardAdapter.updateRouting()for additive changes to one existing peer. It leaves keys, endpoints and the backend handle unchanged, validates the requested change and checks the runtime peer/AllowedIPs before acknowledging it. Inclusion updates prepare expanded AllowedIPs before changing routes; exclusion-only updates leave peer configuration untouched.The update reports
Applied,NotAppliedorStateUnknown. A confirmed OS rejection triggers checked restoration of settings and peer state. Missing completion leaves the outcome unknown: no competing network-settings update is submitted after timeout, and subsequent mutations/path updates are blocked in that adapter instance. The shared completion wait is synchronized; the general update checks its backend error, and the Go bridge returnsEBADFfor an absent handle.Client integration and discussion: https://github.com/amnezia-vpn/amnezia-client/pull/3365. The client uses an injected platform backend and keeps Apple live routing disabled by default pending device validation. Its vendor revision is intentionally unchanged; the integration accepts matching external Swift sources and a Go archive while this library change is reviewed.
The implementation and component validation use the client-pinned base
bdaf0b337b85c815e1dc462505455155b6cdfe79. The target ismaster; its subsequent Xray/version updates are not reverted by this PR and still require validation in the merged dependency build.Client integration commit:
github.com/amnezia-vpn/amnezia-client@ee9875fad5.Validation
-race, including an actual backend with an in-memory fake TUN. They verify absent-handle failure and retention of the same peer object during AllowedIPs updates and compensation.testLatestHandshakeOlderThanCutoffIsNotFresh. Both the cutoff implementation and its test are unchanged frombdaf0b337b85c815e1dc462505455155b6cdfe79.Draft scope and follow-up
This is a draft API/dependency change, not a claim of leak-free operation or uninterrupted traffic on devices. Real Network Extension completion behavior, transport failure with live internet, KillSwitch packet capture, TCP/UDP/DNS continuity, sleep/network changes and Intel runtime tests remain required. Full signed iOS/macOS NE applications have not been built or run.
The associated client currently allows additions only in an existing inclusion/exclusion session. Its empty-list/full-tunnel transition, removal, mode switching, automatic reconnect and dynamic domain/CDN rules are outside this draft. After native validation, the client can pin the matching Swift/Go revision and enable the capability. The pre-existing handshake-cutoff failure needs separate resolution.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.