mirror of
https://github.com/amnezia-vpn/amneziawg-linux-kernel-module.git
synced 2026-10-13 21:34:34 +00:00
[PR #249] fix: preserve non-byte-aligned IPv6 bogus endpoint prefixes #262
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-linux-kernel-module#262
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-linux-kernel-module/pull/249
Author: @HeisLuka
Created: 9/14/2026
Status: 🔄 Open
Base:
master← Head:fix/bogus-endpoints-ipv6-prefix-bits📝 Commits (1)
c55d5abfix: preserve partial IPv6 bogus endpoint prefix📊 Changes
1 file changed (+11 additions, -11 deletions)
View changed files
📝
src/netlink.c(+11 -11)📄 Description
Summary
Preserve the configured IPv6 prefix when generating obfuscated peer endpoints for non-byte-aligned prefixes.
generate_ipv6_address_with_prefix() currently randomizes the suffix starting at prefix_bytes before handling a partial prefix byte.
For prefixes that are not multiples of 8, such as /65, /73, or /127, this overwrites the byte that still contains part of the network prefix. The subsequent mask therefore preserves random bits instead of the configured prefix bits, allowing the generated address to fall outside the requested IPv6 prefix.
This change handles the partial byte first:
preserve the prefix bits from the configured address;
randomize only the host bits in that byte;
advance to the next byte;
randomize the remaining suffix bytes.
Byte-aligned prefixes keep their existing behavior. /0 still randomizes the full address, and /128 remains unchanged.
Scope
Only the optional IPv6 bogus_endpoints address generator changes.
The feature remains disabled by default.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.