portlist,tstest: skip tests on kernels with /proc/net/tcp regression

Linux kernel versions 6.6.102-104 and 6.12.42-45 have a regression
in /proc/net/tcp that causes seek operations to fail with "illegal seek".
This breaks portlist tests on these kernels.

Add kernel version detection for Linux systems and a SkipOnKernelVersions
helper to tstest. Use it to skip affected portlist tests on the broken
kernel versions.

Thanks to philiptaron for the list of kernels with the issue and fix.

Updates #16966

Signed-off-by: Andrew Dunham <andrew@tailscale.com>
This commit is contained in:
Andrew Dunham
2025-11-21 17:55:14 -05:00
committed by Andrew Dunham
parent 1ccece0f78
commit 16587746ed
5 changed files with 112 additions and 1 deletions
+15
View File
@@ -5,12 +5,24 @@ package portlist
import (
"net"
"runtime"
"testing"
"tailscale.com/tstest"
)
func maybeSkip(t *testing.T) {
if runtime.GOOS == "linux" {
tstest.SkipOnKernelVersions(t,
"https://github.com/tailscale/tailscale/issues/16966",
"6.6.102", "6.6.103", "6.6.104",
"6.12.42", "6.12.43", "6.12.44", "6.12.45",
)
}
}
func TestGetList(t *testing.T) {
maybeSkip(t)
tstest.ResourceCheck(t)
var p Poller
@@ -25,6 +37,7 @@ func TestGetList(t *testing.T) {
}
func TestIgnoreLocallyBoundPorts(t *testing.T) {
maybeSkip(t)
tstest.ResourceCheck(t)
ln, err := net.Listen("tcp", "127.0.0.1:0")
@@ -47,6 +60,8 @@ func TestIgnoreLocallyBoundPorts(t *testing.T) {
}
func TestPoller(t *testing.T) {
maybeSkip(t)
var p Poller
p.IncludeLocalhost = true
get := func(t *testing.T) []Port {