[PR #64] wg-quick: android: prefer kernel module over userspace for AWG configs #71

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

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amneziawg-tools/pull/64
Author: @erophey7
Created: 8/8/2026
Status: 🔄 Open

Base: master ← Head: fix/android-kernel-first


📝 Commits (2)

  • 4a7eb95 wg-quick: android: prefer kernel module over userspace for AWG configs
  • b69bebe Merge branch 'master' into fix/android-kernel-first

📊 Changes

1 file changed (+10 additions, -40 deletions)

View changed files

📝 src/wg-quick/android.c (+10 -40)

📄 Description

What

Make wg-quick's Android integration prefer the amneziawg kernel module over the userspace amneziawg-go binary for configurations that use AWG obfuscation parameters.

Why

add_if() previously routed any config containing AmneziaWG parameters (Jc, Jmin, Jmax, S1-S4, H1-H4, I1-I5) to the userspace amneziawg-go binary, even when the kernel module is present. Since amneziawg-go is not shipped with the Android app, kernel-mode tunnels with AWG obfuscation failed with amneziawg-go: inaccessible or not found (exit 127).

The kernel module supports all these parameters via awg setconf, so the selection is now kernel-first:

  • use ip link add ... type amneziawg whenever /sys/module/amneziawg is available;
  • keep amneziawg-go only as a fallback for devices without the kernel module.

Drops the now-unused is_awg_on flag and the parser branches that only existed to set it.

Testing performed

  • Built wg-quick for Android target.
  • Pushed to device (Xiaomi 11 Lite 5 NE, kernel 5.4.302 QGKI with amneziawg kernel module 3.0.20260805), kernel-mode tunnel with obfuscation (Jc/Jmin) connects successfully and gets a handshake.
  • wg-quick up / wg-quick down cycle verified in both kernel-module and userspace-fallback modes.

Files changed

  • src/wg-quick/android.c (+10, −40)

🔄 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/amneziawg-tools/pull/64 **Author:** [@erophey7](https://github.com/erophey7) **Created:** 8/8/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/android-kernel-first` --- ### 📝 Commits (2) - [`4a7eb95`](https://github.com/amnezia-vpn/amneziawg-tools/commit/4a7eb958f9920294a5e0a84ff540c1a7eead43bb) wg-quick: android: prefer kernel module over userspace for AWG configs - [`b69bebe`](https://github.com/amnezia-vpn/amneziawg-tools/commit/b69bebea6b9147a1741eb3c1757399ff37c469ab) Merge branch 'master' into fix/android-kernel-first ### 📊 Changes **1 file changed** (+10 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `src/wg-quick/android.c` (+10 -40) </details> ### 📄 Description ## What Make `wg-quick`'s Android integration prefer the amneziawg **kernel module** over the userspace `amneziawg-go` binary for configurations that use AWG obfuscation parameters. ## Why `add_if()` previously routed any config containing AmneziaWG parameters (Jc, Jmin, Jmax, S1-S4, H1-H4, I1-I5) to the userspace `amneziawg-go` binary, even when the kernel module is present. Since `amneziawg-go` is not shipped with the Android app, kernel-mode tunnels with AWG obfuscation failed with `amneziawg-go: inaccessible or not found` (exit 127). The kernel module supports all these parameters via `awg setconf`, so the selection is now kernel-first: - use `ip link add ... type amneziawg` whenever `/sys/module/amneziawg` is available; - keep `amneziawg-go` only as a fallback for devices without the kernel module. Drops the now-unused `is_awg_on` flag and the parser branches that only existed to set it. ## Testing performed - Built `wg-quick` for Android target. - Pushed to device (Xiaomi 11 Lite 5 NE, kernel 5.4.302 QGKI with amneziawg kernel module 3.0.20260805), kernel-mode tunnel with obfuscation (Jc/Jmin) connects successfully and gets a handshake. - `wg-quick up` / `wg-quick down` cycle verified in both kernel-module and userspace-fallback modes. ## Files changed - `src/wg-quick/android.c` (+10, −40) --- <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/amneziawg-tools#71
No description provided.