[PR #270] fix: record handshake completion when sending handshake response #271

Open
opened 2026-10-25 04:17:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/pull/270
Author: @mvkvl
Created: 10/14/2026
Status: 🔄 Open

Base: master ← Head: pr1-handshake


📝 Commits (1)

  • 054f3d3 fix: record handshake completion when sending handshake response

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 src/send.c (+1 -0)

📄 Description

Title

fix: record handshake completion when sending handshake response

Body

Problem

The responder never called wg_timers_handshake_complete() after beginning
a session in wg_packet_send_handshake_response(). As a result,
walltime_last_handshake was only stamped later via
wg_noise_received_with_keypair() on the initiator's first data packet.

When no data packet followed (idle peers, userspace peers with constant
rekeys), the timestamp froze and kernel supervision saw a stale
last_handshake, masking peer death.

Fix

Call wg_timers_handshake_complete() right after session derivation in
wg_packet_send_handshake_response(), mirroring the initiator path in
wg_packet_consume_handshake().

Impact

One-line change in src/send.c. No behavioural change for active peers;
only the handshake timestamp is recorded earlier for idle/responder-only
sessions.

Testing

  • Built against upstream master (4569c4c) on Debian 13 (kernel 6.12.x).
  • Verified on a 3-node WireGuard lab: responder's last_handshake now
    updates immediately after handshake response, without requiring a
    subsequent data packet.

🔄 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/270 **Author:** [@mvkvl](https://github.com/mvkvl) **Created:** 10/14/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `pr1-handshake` --- ### 📝 Commits (1) - [`054f3d3`](https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/commit/054f3d3b3b4d1f75238d927f1e30c36851afd5ad) fix: record handshake completion when sending handshake response ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/send.c` (+1 -0) </details> ### 📄 Description ## Title fix: record handshake completion when sending handshake response ## Body ### Problem The responder never called `wg_timers_handshake_complete()` after beginning a session in `wg_packet_send_handshake_response()`. As a result, `walltime_last_handshake` was only stamped later via `wg_noise_received_with_keypair()` on the initiator's first data packet. When no data packet followed (idle peers, userspace peers with constant rekeys), the timestamp froze and kernel supervision saw a stale `last_handshake`, masking peer death. ### Fix Call `wg_timers_handshake_complete()` right after session derivation in `wg_packet_send_handshake_response()`, mirroring the initiator path in `wg_packet_consume_handshake()`. ### Impact One-line change in `src/send.c`. No behavioural change for active peers; only the handshake timestamp is recorded earlier for idle/responder-only sessions. ### Testing - Built against upstream `master` (4569c4c) on Debian 13 (kernel 6.12.x). - Verified on a 3-node WireGuard lab: responder's `last_handshake` now updates immediately after handshake response, without requiring a subsequent data packet. --- <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#271
No description provided.