From 1bb477d2ee3ca7137543160f6dbfd97a5f6b5c62 Mon Sep 17 00:00:00 2001 From: "Matt N." Date: Sat, 25 Apr 2026 20:18:17 -0700 Subject: [PATCH] Fix ping status PID check to use 16 bits for comparison If `/proc/sys/kernel/pid_max` exceeds 16 bits then the ping check could incorrectly fail. --- status/ping-monitor.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/status/ping-monitor.pl b/status/ping-monitor.pl index 71a27b8da..4b2b1772e 100755 --- a/status/ping-monitor.pl +++ b/status/ping-monitor.pl @@ -176,7 +176,8 @@ sub ping_icmp $len_msg)); if (($from_type == $ICMP_ECHOREPLY) && ($from_ip eq $ip) && - ($from_pid == $$) && # Does the packet check out? + # ping uses only 16 bits for the PID + ($from_pid == ($$ & 0xffff)) && # Does the packet check out? ($from_seq == $ping_seq)) { $ret = 1; # It's a winner