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.
This commit is contained in:
Matt N.
2026-04-25 20:18:17 -07:00
committed by GitHub
parent c9e577e220
commit 1bb477d2ee

View File

@@ -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