[PR #164] fix: restore per-peer legacy WireGuard client support #213

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

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/pull/164
Author: @otternetwork
Created: 4/5/2026
Status: 🔄 Open

Base: master ← Head: fix/restore-legacy-client-support


📝 Commits (1)

  • 27c4269 fix: restore per-peer legacy WireGuard client support

📊 Changes

2 files changed (+86 additions, -43 deletions)

View changed files

📝 src/receive.c (+27 -6)
📝 src/send.c (+59 -37)

📄 Description

Summary

Restores the per-peer advanced_security checks in send and receive paths that were removed by commit e939553 ("feat: implement H1-H4 ranged headers"). This re-enables mixed-mode operation where an AmneziaWG server can simultaneously serve both standard WireGuard and AmneziaWG clients, as originally introduced in PR #16.

  • Gate I-spec and junk packet sending on peer->advanced_security
  • Use standard WG message types for legacy peers, custom mh_genheader() headers for AWG peers
  • Skip junk padding for legacy peers
  • Cookie responses match the header type of the incoming packet
  • Add fallback in prepare_awg_message() to accept standard WireGuard packets
  • Add standard WG message type checks in packet dispatch

The auto-detection in noise.c (which sets peer->advanced_security based on whether the incoming handshake used a custom magic header) was already correct and is unchanged.

Test plan

  • Legacy WireGuard client connects to AWG server with custom H1-H4/S1-S2
  • AmneziaWG 2.0 client connects to AWG server with ranged H1-H4
  • AWG server with no custom parameters works as standard WireGuard

Closes #162


🔄 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-linux-kernel-module/pull/164 **Author:** [@otternetwork](https://github.com/otternetwork) **Created:** 4/5/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/restore-legacy-client-support` --- ### 📝 Commits (1) - [`27c4269`](https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/commit/27c426989ca6556b9ee07630cfb2955d255a525d) fix: restore per-peer legacy WireGuard client support ### 📊 Changes **2 files changed** (+86 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `src/receive.c` (+27 -6) 📝 `src/send.c` (+59 -37) </details> ### 📄 Description ## Summary Restores the per-peer `advanced_security` checks in send and receive paths that were removed by commit e939553 ("feat: implement H1-H4 ranged headers"). This re-enables mixed-mode operation where an AmneziaWG server can simultaneously serve both standard WireGuard and AmneziaWG clients, as originally introduced in PR #16. - Gate I-spec and junk packet sending on `peer->advanced_security` - Use standard WG message types for legacy peers, custom `mh_genheader()` headers for AWG peers - Skip junk padding for legacy peers - Cookie responses match the header type of the incoming packet - Add fallback in `prepare_awg_message()` to accept standard WireGuard packets - Add standard WG message type checks in packet dispatch The auto-detection in `noise.c` (which sets `peer->advanced_security` based on whether the incoming handshake used a custom magic header) was already correct and is unchanged. ## Test plan - [x] Legacy WireGuard client connects to AWG server with custom H1-H4/S1-S2 - [x] AmneziaWG 2.0 client connects to AWG server with ranged H1-H4 - [x] AWG server with no custom parameters works as standard WireGuard Closes #162 --- <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-linux-kernel-module#213
No description provided.