[PR #240] fix: honor RejectAfterTime on data paths #253

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

📋 Pull Request Information

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

Base: master ← Head: fix/honor-reject-after-time-data-paths


📝 Commits (1)

  • 1c00119 fix: honor RejectAfterTime on data paths

📊 Changes

2 files changed (+8 additions, -2 deletions)

View changed files

📝 src/receive.c (+5 -1)
📝 src/send.c (+3 -1)

📄 Description

Summary

Use the configured RejectAfterTime range when expiring data-path keypairs
instead of always using the fixed REJECT_AFTER_TIME constant.

Both send and receive now snapshot the configured range and use its upper bound
as the keychain expiration time, matching amneziawg-go's
keychainExpireTime() semantics.

Previously, for example, RejectAfterTime = 300 still caused the kernel data
paths to invalidate a key after the fixed 180-second default, while a value
below 180 seconds was also ignored.

Using the upper bound rather than picking a fresh random value for every packet
keeps the expiration boundary stable and matches the Go implementation.

Scope

This PR addresses problem 1 from #227 only.

The failed-handshake zero-key cleanup and negative receive refresh timeout are
handled separately.

Related to #227


🔄 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/240 **Author:** [@HeisLuka](https://github.com/HeisLuka) **Created:** 9/14/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/honor-reject-after-time-data-paths` --- ### 📝 Commits (1) - [`1c00119`](https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/commit/1c001198e92c3c4b6e6bd0bf1fe6688750361327) fix: honor RejectAfterTime on data paths ### 📊 Changes **2 files changed** (+8 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/receive.c` (+5 -1) 📝 `src/send.c` (+3 -1) </details> ### 📄 Description ## Summary Use the configured `RejectAfterTime` range when expiring data-path keypairs instead of always using the fixed `REJECT_AFTER_TIME` constant. Both send and receive now snapshot the configured range and use its upper bound as the keychain expiration time, matching `amneziawg-go`'s `keychainExpireTime()` semantics. Previously, for example, `RejectAfterTime = 300` still caused the kernel data paths to invalidate a key after the fixed 180-second default, while a value below 180 seconds was also ignored. Using the upper bound rather than picking a fresh random value for every packet keeps the expiration boundary stable and matches the Go implementation. ## Scope This PR addresses problem 1 from #227 only. The failed-handshake zero-key cleanup and negative receive refresh timeout are handled separately. Related to #227 --- <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#253
No description provided.