Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fping responses misdelivered on FreeBSD #206

Open
clarsen opened this issue Nov 25, 2020 · 3 comments
Open

fping responses misdelivered on FreeBSD #206

clarsen opened this issue Nov 25, 2020 · 3 comments
Labels

Comments

@clarsen
Copy link

clarsen commented Nov 25, 2020

On FreeBSD, the PIDs are as large as 99999, so if multiple fping processes are running there's a chance ident4 = PID & 0xffff will collide - which happens on monitoring hosts, like Nagios, that run fping often and simultaneously on a single IP address at a time.

If you have one IP up and one IP down and the two fping's PID ident4s collide, then the process pinging the down IP may see a reply from the up IP.

While the FreeBSD implementation of ping calls connect() which results in echo replies from undesired hosts being dropped before ever being delivered to the process, fping doesn't, so it has to rely on ICMP identifier to filter out the undesired responses.

It appears wait_for_reply() although it filters out ICMP identifier mismatch, it doesn't filter out on source IP address.

clarsen pushed a commit to clarsen/fping that referenced this issue Nov 25, 2020
It's a slow linear search, but simpler is correcter.
@schweikert schweikert added the bug label Aug 7, 2021
@clarsen
Copy link
Author

clarsen commented May 31, 2022

bump on this issue - there's a pull request that fixes this that we've been running with for 18 months or so so far...

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Jun 2, 2022
fping derives the ident it puts in the outbound packet to from the
low 16 bits of the process id. This means a busy nagios server can
see collisions. More details on this issue and a patch to solve it
here:

    schweikert/fping#206

Apply the patch from the github issue:

PR:		264402
Reported by:	Case Larsen
Approved by:	jharris (maintainer)
@eKrajnak
Copy link

eKrajnak commented Jun 12, 2022

I'm experiencing strange issue with fping 5.0 (bullseye repo) on Debian 11 (x64) and I think it colidates with this issue. Fping is used by Zabbix, we spawn 130 pinger processes simultaneously, usually busy for 40-50%, pinging 1k hosts every second (params -C10 -i0 -S [publicip]). Usually after VM reboot, random fping processes report random packet loss for random targets, even when I see icmp response in tcpdump. It's true that we ping a tens of permanently unavailable targets. This situation usually lasts few days, then disappear.

Is this bug affecting Linux distro also? Can we except fix for bullseye repos?
Thank you

@hmh
Copy link
Contributor

hmh commented Jun 14, 2022

Once it is fixed upstream, you have to file a Debian bug explaining the situation, pointing to this bug, and identifying the affected (buggy) versions of fping and the fixed version. Then, it depends on whether the downstream Debian fping maintainer will prepare a debian stable update for fping (possibly backporting only this fix).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants