RIPE-NCC / ripe-atlas-probe-measurements

RIPE Atlas probe measurement source code
Other
41 stars 18 forks source link

Fix receiving ICMPv6 echo replies on systems with a 32-bit pid_t #10

Closed grahamedgecombe closed 2 years ago

grahamedgecombe commented 2 years ago

When an ICMPv6 echo request is sent, the ID field is set to the pid. 32-bit pids are explicitly truncated to 16 bits.

However, the same truncation is not performed when the ID field is checked against the pid when receiving a reply. This causes all replies to be ignored if the pid of the current process is greater than 65535.

This commit fixes the problem by truncating the pid in the code for receiving a reply too.

gmeyerRIPE commented 2 years ago

Hello Graham,

We tested your change by verifying that having a PID number greater than 65535 causes evping command to fail. I've attached a script that was used with probe-busybox before your patch and after.

pidcheck.sh.txt

The output prior to your patch: before.txt

The output after your patch: after.txt

We will merge in your changes with the next release.

Regards, Guy & Michel

gmeyerRIPE commented 2 years ago

We have checked Max PID numbers (/proc/sys/kernel/pid_max) on various linux distros:

Indicating that for newer Linux distros it is likely that this patch is needed.

Thanks, Guy