mirror of
https://github.com/amnezia-vpn/amneziawg-linux-kernel-module.git
synced 2026-10-13 21:34:34 +00:00
[GH-ISSUE #251] Introducing strscpy broke compatibility with older kernels. #136
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#136
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?
Originally created by @achpile on GitHub (Sep 16, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/251
Here's the commit:
github.com/amnezia-vpn/amneziawg-linux-kernel-module@40c812ebc8strscpy was introduced in kernel v4.3
so it is impossible to compile for older kernels.
Maybe something like this should help:
@achpile commented on GitHub (Sep 16, 2026):
UPD: I don't want to add new issue. There's also usage of ip6_dst_lookup_flow in socket.c.
In kernel v5.4.5 it is:
struct dst_entry *ip6_dst_lookup_flow(struct net *net, const struct sock *sk, struct flowi6 *fl6, const struct in6_addr *final_dst);
In kernel v5.4.4 it had less arguments:
struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6, const struct in6_addr *final_dst);
So fix like that should do the trick:
@achpile commented on GitHub (Sep 25, 2026):
Also before 3.14 ip6_dst_lookup_flow had syntax like this:
struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
const struct in6_addr *final_dst,
bool can_sleep);
There was
can_sleepargument. So I guess correct way would be like this: