[PR #137] [MERGED] Fix network stats reported for default 6.8 kernels on Ubuntu 24.04 LTS #199

Closed
opened 2026-10-13 21:07:33 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/pull/137
Author: @petrows
Created: 2/8/2026
Status: ✅ Merged
Merged: 2/10/2026
Merged by: @ygurov

Base: master ← Head: Fix-network-stats-on-ubuntu-24-04


📝 Commits (1)

  • 702ac77 Fix network stats reported for default 6.8 kernels on Ubuntu 24.04

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/compat/compat.h (+1 -1)

📄 Description

Driver has compat COMPAT_CANNOT_USE_PCPU_STAT_TYPE switch, where new reporting method is activated for modern kernels (see issue #120 and PR #129 ).

Ubuntu 24.04 has kernel version 6.8.0-100 as default via linux-image package where tstats reporting method looks broken, and compat mode has to be relaxed to cover 6.8 kernels as well.

Default Ubuntu 24.04 behavior:

$ uname -a
Linux test 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux

$ dmesg
[ 1159.610796] amneziawg: module verification failed: signature and/or required key missing - tainting kernel
[ 1159.612042] amneziawg: AmneziaWG 1.0.20251009 loaded. See amnezia.org for information.
[ 1159.612044] amneziawg: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[ 1159.612045] amneziawg: Copyright (C) 2024-2025 AmneziaVPN <admin@amnezia.org>. All Rights Reserved.

# Ifconfig reports zero traffic:
$ ifconfig
test: flags=209<UP,POINTOPOINT,RUNNING,NOARP>  mtu 1420
        inet 1.2.3.4  netmask 255.255.255.255  destination 4.3.2.1
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

# While AmneziaWG works and reports traffic correctly:
$ awg
peer: XXXYYY
  endpoint: 1.1.1.1:8000
  allowed ips: 0.0.0.0/0
  latest handshake: 11 seconds ago
  transfer: 1.31 KiB received, 20.44 KiB sent

With COMPAT_CANNOT_USE_PCPU_STAT_TYPE activated:

# Ifconfig reports correct values

test: flags=209<UP,POINTOPOINT,RUNNING,NOARP>  mtu 1420
        inet 1.2.3.4  netmask 255.255.255.255  destination 4.3.2.1
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 7  bytes 892 (892.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 84  bytes 20890 (20.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I have rechecked code in device.c, the NETDEV_PCPU_STAT_TSTATS flag is defined and used correctly and has to be supported by 6.8. kernel. Likely this problem is Ubuntu-specific. Problem is fixed in 6.11.0-17-generic kernel (the next minor version avaliable, there is no 9 and 10 versions available).

This issue looks critical, as reporting breaks monitoring and observing using actual default Ubuntu LTS packages.


🔄 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/137 **Author:** [@petrows](https://github.com/petrows) **Created:** 2/8/2026 **Status:** ✅ Merged **Merged:** 2/10/2026 **Merged by:** [@ygurov](https://github.com/ygurov) **Base:** `master` ← **Head:** `Fix-network-stats-on-ubuntu-24-04` --- ### 📝 Commits (1) - [`702ac77`](https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/commit/702ac7740a3ef48712b3fa6f370a2141274b6ba6) Fix network stats reported for default 6.8 kernels on Ubuntu 24.04 ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/compat/compat.h` (+1 -1) </details> ### 📄 Description Driver has compat `COMPAT_CANNOT_USE_PCPU_STAT_TYPE` switch, where new reporting method is activated for modern kernels (see issue #120 and PR #129 ). Ubuntu 24.04 has kernel version 6.8.0-100 as default via `linux-image` package where `tstats` reporting method looks broken, and compat mode has to be relaxed to cover 6.8 kernels as well. Default Ubuntu 24.04 behavior: ```bash $ uname -a Linux test 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux $ dmesg [ 1159.610796] amneziawg: module verification failed: signature and/or required key missing - tainting kernel [ 1159.612042] amneziawg: AmneziaWG 1.0.20251009 loaded. See amnezia.org for information. [ 1159.612044] amneziawg: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. [ 1159.612045] amneziawg: Copyright (C) 2024-2025 AmneziaVPN <admin@amnezia.org>. All Rights Reserved. # Ifconfig reports zero traffic: $ ifconfig test: flags=209<UP,POINTOPOINT,RUNNING,NOARP> mtu 1420 inet 1.2.3.4 netmask 255.255.255.255 destination 4.3.2.1 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 # While AmneziaWG works and reports traffic correctly: $ awg peer: XXXYYY endpoint: 1.1.1.1:8000 allowed ips: 0.0.0.0/0 latest handshake: 11 seconds ago transfer: 1.31 KiB received, 20.44 KiB sent ``` With `COMPAT_CANNOT_USE_PCPU_STAT_TYPE` activated: ```bash # Ifconfig reports correct values test: flags=209<UP,POINTOPOINT,RUNNING,NOARP> mtu 1420 inet 1.2.3.4 netmask 255.255.255.255 destination 4.3.2.1 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) RX packets 7 bytes 892 (892.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 84 bytes 20890 (20.8 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` I have rechecked code in `device.c`, the `NETDEV_PCPU_STAT_TSTATS` flag is defined and used correctly and has to be supported by 6.8. kernel. Likely this problem is Ubuntu-specific. Problem is fixed in `6.11.0-17-generic` kernel (the next minor version avaliable, there is no 9 and 10 versions available). This issue looks critical, as reporting breaks monitoring and observing using actual default Ubuntu LTS packages. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-13 21:07:33 +00:00
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#199
No description provided.