From 6df2c9ccbfb2c764878e2b130d9a7b6690a00901 Mon Sep 17 00:00:00 2001 From: anti Date: Fri, 10 Apr 2026 16:29:44 -0400 Subject: [PATCH] =?UTF-8?q?revert(os=5Ffingerprint):=20undo=20ip=5Fno=5Fpm?= =?UTF-8?q?tu=5Fdisc=3D1=20for=20windows=20=E2=80=94=20was=20incorrect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ip_no_pmtu_disc controls PMTU discovery for UDP/ICMP paths only. TI=Z originates from ip_select_ident() in the kernel TCP stack setting IP ID=0 for DF=1 TCP packets — a namespace-scoped sysctl cannot change this. The previous commit was based on incorrect root-cause analysis. --- decnet/os_fingerprint.py | 2 +- tests/test_os_fingerprint.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/decnet/os_fingerprint.py b/decnet/os_fingerprint.py index 25cc129..aa17b86 100644 --- a/decnet/os_fingerprint.py +++ b/decnet/os_fingerprint.py @@ -48,7 +48,7 @@ OS_SYSCTLS: dict[str, dict[str, str]] = { "net.ipv4.tcp_window_scaling": "1", "net.ipv4.tcp_sack": "1", "net.ipv4.tcp_ecn": "0", - "net.ipv4.ip_no_pmtu_disc": "1", # avoid TI=Z: forces non-zero IP IDs + "net.ipv4.ip_no_pmtu_disc": "0", "net.ipv4.tcp_fin_timeout": "30", }, "bsd": { diff --git a/tests/test_os_fingerprint.py b/tests/test_os_fingerprint.py index ffa7afb..970655b 100644 --- a/tests/test_os_fingerprint.py +++ b/tests/test_os_fingerprint.py @@ -133,10 +133,8 @@ def test_linux_ip_no_pmtu_disc_is_0(): assert get_os_sysctls("linux")["net.ipv4.ip_no_pmtu_disc"] == "0" -def test_windows_ip_no_pmtu_disc_is_1(): - # Set to 1 (not 0) to avoid TI=Z IP ID signal: when ip_no_pmtu_disc=0 the - # kernel uses IP ID=0 for DF packets, which nmap classifies as Linux embedded. - assert get_os_sysctls("windows")["net.ipv4.ip_no_pmtu_disc"] == "1" +def test_windows_ip_no_pmtu_disc_is_0(): + assert get_os_sysctls("windows")["net.ipv4.ip_no_pmtu_disc"] == "0" def test_embedded_ip_no_pmtu_disc_is_1():