mirror of
https://github.com/amnezia-vpn/amneziawg-linux-kernel-module.git
synced 2026-10-13 21:34:34 +00:00
[PR #248] fix: avoid undefined shift for /0 bogus endpoint prefixes #260
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#260
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/248
Author: @HeisLuka
Created: 9/14/2026
Status: 🔄 Open
Base:
master← Head:fix/bogus-endpoints-prefix-zero-shift📝 Commits (1)
0e47b5ffix: avoid undefined IPv4 prefix shift📊 Changes
1 file changed (+1 additions, -6 deletions)
View changed files
📝
src/netlink.c(+1 -6)📄 Description
Summary
Avoid an undefined 32-bit shift when generating a bogus IPv4 endpoint for a
/0prefix.generate_ipv4_address_with_prefix()currently computes the suffix mask using a 32-bit1U. Whenprefix_len == 0, this becomes1U << 32, which is undefined for a 32-bitunsigned int.This change computes the mask in 64 bits and then narrows it back to
u32.The existing validation already limits
prefix_lento the range0..32, so the 64-bit shift is always valid.For
/0, the resulting suffix mask is0xffffffff. Prefixes from/1through/32keep their existing behavior.This fixes the
bogus_endpointsissue that was previously included in the closed #189, without bringing in that PR's unrelated cookie-reply change.Scope
Only the optional IPv4
bogus_endpointsprefix generation path is changed.The feature remains disabled by default.
Related to #189
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.