[GH-ISSUE #204] AmneziaWG 3.0 module fails to build on kernels < 6.7 (nla_put_uint) - Debian 12, Ubuntu 22.04 #120

Closed
opened 2026-10-13 21:06:44 +00:00 by bsakaguchi · 4 comments
Owner

Originally created by @bivlked on GitHub (Jul 31, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/204

Originally assigned to: @ygurov on GitHub.

After the AmneziaWG 3.0 merge (#192) the module no longer builds on kernels older than 6.7. src/netlink.c:448 calls nla_put_uint() for the H1-H4 attributes, and that helper only landed in mainline 6.7. There's no compat shim, so on older kernels the build fails:

netlink.c:448:21: error: implicit declaration of function 'nla_put_uint'; did you mean 'nla_put_u32'? [-Werror=implicit-function-declaration]
  448 |         nla_put_uint(skb, WGDEVICE_A_H1, wg->init_header) ||

I hit this on a clean Debian 12 (bookworm), kernel 6.1.0-51-amd64, building the current PPA amneziawg-dkms (the 3.0 build, commit 7cf785d) with dkms build. It applies to any pre-6.7 kernel: Ubuntu 22.04 (5.15), Raspberry Pi OS bookworm (6.6), and so on.

Since the PPA switched to 3.0, this now breaks a fresh apt install amneziawg on Debian 12: the DKMS build fails in the postinst and dpkg leaves the packages unconfigured.

The 1.0.x line (last tag v1.0.20260725) still builds on these kernels, since it uses nla_put_string for the headers. Looks like a different root cause from #190 (ipv6_stub undeclared on a 7.1 sid kernel, i.e. too new; this one is too old).

A compat definition for nla_put_uint in src/compat/compat.h for kernels < 6.7 would fix it. Happy to test a patch on Debian 12 / 6.1.

Originally created by @bivlked on GitHub (Jul 31, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/204 Originally assigned to: @ygurov on GitHub. After the AmneziaWG 3.0 merge (#192) the module no longer builds on kernels older than 6.7. `src/netlink.c:448` calls `nla_put_uint()` for the H1-H4 attributes, and that helper only landed in mainline 6.7. There's no compat shim, so on older kernels the build fails: ``` netlink.c:448:21: error: implicit declaration of function 'nla_put_uint'; did you mean 'nla_put_u32'? [-Werror=implicit-function-declaration] 448 | nla_put_uint(skb, WGDEVICE_A_H1, wg->init_header) || ``` I hit this on a clean Debian 12 (bookworm), kernel 6.1.0-51-amd64, building the current PPA `amneziawg-dkms` (the 3.0 build, commit 7cf785d) with `dkms build`. It applies to any pre-6.7 kernel: Ubuntu 22.04 (5.15), Raspberry Pi OS bookworm (6.6), and so on. Since the PPA switched to 3.0, this now breaks a fresh `apt install amneziawg` on Debian 12: the DKMS build fails in the postinst and dpkg leaves the packages unconfigured. The 1.0.x line (last tag `v1.0.20260725`) still builds on these kernels, since it uses `nla_put_string` for the headers. Looks like a different root cause from #190 (`ipv6_stub undeclared` on a 7.1 sid kernel, i.e. too new; this one is too old). A compat definition for `nla_put_uint` in `src/compat/compat.h` for kernels < 6.7 would fix it. Happy to test a patch on Debian 12 / 6.1.
Author
Owner

@ygurov commented on GitHub (Jul 31, 2026):

Hi @bivlked,
Thanks for reporting the issue. Made a PR to use the plain nla_put calls, please check if it works fine for you
https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/pull/205

<!-- gh-comment-id:5145314291 --> @ygurov commented on GitHub (Jul 31, 2026): Hi @bivlked, Thanks for reporting the issue. Made a PR to use the plain nla_put calls, please check if it works fine for you https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/pull/205
Author
Owner

@ygurov commented on GitHub (Jul 31, 2026):

Fixed in github.com/amnezia-vpn/amneziawg-linux-kernel-module@c78a89ee19, introduced v3.0.20260731-04

<!-- gh-comment-id:5145646814 --> @ygurov commented on GitHub (Jul 31, 2026): Fixed in https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/commit/c78a89ee1945d24c6e9c21a442aae87be059a6ca, introduced [v3.0.20260731-04](https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/releases/tag/v3.0.20260731-04)
Author
Owner

@rhclayto commented on GitHub (Jul 31, 2026):

Will this be in the PPA soon? Or is there a way to manually apply this before it gets into the PPA?

<!-- gh-comment-id:5147614481 --> @rhclayto commented on GitHub (Jul 31, 2026): Will this be in the PPA soon? Or is there a way to manually apply this before it gets into the PPA?
Author
Owner

@bivlked commented on GitHub (Aug 1, 2026):

@ygurov works here, thanks for turning it around the same evening. Debian 12, kernel 6.1.0-51: apt install amneziawg-dkms goes through, DKMS builds against 6.1 with no implicit declaration of function 'nla_put_uint', and the module loads as 3.0.20260731-04. awg-quick up then brings up an interface with AmneziaWG 2.0 parameters, and awg show reads H1-H4 back correctly, which is the part the patch changed. Userspace tools are still v3.0.20260730 and work fine against the -04 module.

@rhclayto it is already in the PPA, nothing to apply by hand. The build is published for all three series, so both cases from the issue title are covered:

  • focal 1.0.0-0~202608010143+c78a89e~ubuntu20.04.1
  • jammy 1.0.0-0~202608010158+c78a89e~ubuntu22.04.1
  • noble 1.0.0-0~202608010147+c78a89e~ubuntu24.04.1

So apt update && apt install amneziawg-dkms is enough. There are no Debian builds in the PPA, so on Debian 12 apt points at the focal series - same thing my installer does.

Two things worth knowing if the build still fails after the upgrade:

  • a build that failed earlier leaves amneziawg-dkms half-configured, and the new version will not install on top of that: apt purge amneziawg-dkms amneziawg and rm -rf /usr/src/amneziawg-* first;
  • on this box the provider image shipped kernel 6.1.0-29 while the repo was already at 6.1.0-51, so there were no headers for the running kernel at all: apt full-upgrade and reboot before installing.
<!-- gh-comment-id:5150369927 --> @bivlked commented on GitHub (Aug 1, 2026): @ygurov works here, thanks for turning it around the same evening. Debian 12, kernel 6.1.0-51: `apt install amneziawg-dkms` goes through, DKMS builds against 6.1 with no `implicit declaration of function 'nla_put_uint'`, and the module loads as 3.0.20260731-04. `awg-quick up` then brings up an interface with AmneziaWG 2.0 parameters, and `awg show` reads H1-H4 back correctly, which is the part the patch changed. Userspace tools are still v3.0.20260730 and work fine against the -04 module. @rhclayto it is already in the PPA, nothing to apply by hand. The build is published for all three series, so both cases from the issue title are covered: - focal `1.0.0-0~202608010143+c78a89e~ubuntu20.04.1` - jammy `1.0.0-0~202608010158+c78a89e~ubuntu22.04.1` - noble `1.0.0-0~202608010147+c78a89e~ubuntu24.04.1` So `apt update && apt install amneziawg-dkms` is enough. There are no Debian builds in the PPA, so on Debian 12 apt points at the focal series - same thing my installer does. Two things worth knowing if the build still fails after the upgrade: - a build that failed earlier leaves `amneziawg-dkms` half-configured, and the new version will not install on top of that: `apt purge amneziawg-dkms amneziawg` and `rm -rf /usr/src/amneziawg-*` first; - on this box the provider image shipped kernel 6.1.0-29 while the repo was already at 6.1.0-51, so there were no headers for the running kernel at all: `apt full-upgrade` and reboot before installing.
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#120
No description provided.