You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IPv4 ping is broken on Flatcar Container Linux #122
Thanks for reporting this @artherd42, and the follow up investigation.
I think it's a bug in Flatcar Linux if it's not stripping IP header for recvmsg() system call. I wonder what they do differently, and if GNU ping does things differently on Flatcar Linux. I'll try to find out more.
It seems "privileged" (RAW socket) IPv4 ping (use_datagram_socket: false option) has been broken on Linux for quite some time (same as MacOS maybe, but on MacOS even DGRAM socket was broken). It's possible I didn't find it earlier as all of my personal setup, and the setup at my current and previous employers, use the "unprivileged" (DGRAM socket) ping. I'll set up some integration tests for raw sockets as well.
Did you switch the use_datagram_socket option when you moved from CoreOS to Flatcar Linux?
I'll send a fix pretty soon, but it will look similar to what you did.
I did some more testing ping probes with the different Cloudprober versions. On CoreOS, v0.11.0 was working. Cloudprober v0.11.1 is the last good version on Flatcar Linux 5.15.30. From v0.11.2 onwards, IPv4 ping probes are failing on Flatcar Linux.
I see. That makes sense. Before v0.11.2 we were using recvfrom system call (through ReadFrom Go function), which strips IP header regardless of the socket type. We switched to recvmsg so that we can read control messages to find the socket receive timestamp (for better latency measurement).
Thank you so much verifying @artherd42. Much appreciated.
Next release will contain the fix, in the meantime, you can continue using the workaround that you're using, or build unreleased binaries from the head.
Activity
manugarg commentedon Mar 29, 2022
Thanks for reporting this @artherd42, and the follow up investigation.
I think it's a bug in Flatcar Linux if it's not stripping IP header for recvmsg() system call. I wonder what they do differently, and if GNU ping does things differently on Flatcar Linux. I'll try to find out more.
artherd42 commentedon Mar 29, 2022
I have found this code for the ping_recvmsg call in the Flatcar Linux repo.
manugarg commentedon Mar 29, 2022
It seems "privileged" (RAW socket) IPv4 ping (
use_datagram_socket: falseoption) has been broken on Linux for quite some time (same as MacOS maybe, but on MacOS even DGRAM socket was broken). It's possible I didn't find it earlier as all of my personal setup, and the setup at my current and previous employers, use the "unprivileged" (DGRAM socket) ping. I'll set up some integration tests for raw sockets as well.Did you switch the
use_datagram_socketoption when you moved from CoreOS to Flatcar Linux?I'll send a fix pretty soon, but it will look similar to what you did.
Thanks once again for reporting this.
manugarg commentedon Mar 29, 2022
Linux uses iputils package for ping implementation, and here is where it does different things based on RAW and DGRAM sockets:
Compute the IP header len:
https://github.com/iputils/iputils/blob/2410ed15e66a1acfcee03fee493276e1be6373e3/ping/ping.c#L1492
Move past the IP header:
https://github.com/iputils/iputils/blob/2410ed15e66a1acfcee03fee493276e1be6373e3/ping/ping.c#L1524
[ping] Fix privileged IPv4 ping (RAW socket).
[ping] Fix privileged IPv4 ping (RAW socket).
manugarg commentedon Mar 29, 2022
Leaving it open to get confirmation regarding this:
artherd42 commentedon Mar 30, 2022
No, I am still running the ping_probe with
use_datagram_socket: false.manugarg commentedon Mar 30, 2022
use_datagram_socket: falseenables RAW sockets, that's case that was broken for IPv4 Linux. So, failure on Flatcar Linux is explainable.However, I am surprised this option was working on CoreOS. Were you using the same Cloudprober version on CoreOS as well.
(FYI: I'll cut a new release with #123 (v0.11.7) by the end of next week.)
artherd42 commentedon Mar 30, 2022
I did some more testing ping probes with the different Cloudprober versions. On CoreOS, v0.11.0 was working. Cloudprober v0.11.1 is the last good version on Flatcar Linux 5.15.30. From v0.11.2 onwards, IPv4 ping probes are failing on Flatcar Linux.
manugarg commentedon Mar 30, 2022
I see. That makes sense. Before v0.11.2 we were using
recvfromsystem call (through ReadFrom Go function), which strips IP header regardless of the socket type. We switched torecvmsgso that we can read control messages to find the socket receive timestamp (for better latency measurement).Thank you so much verifying @artherd42. Much appreciated.
Next release will contain the fix, in the meantime, you can continue using the workaround that you're using, or build unreleased binaries from the head.
[ping] Run privileged ping (RAW socket) tests as well.
manugarg commentedon Mar 31, 2022
I've added a few tests (#125, #126, #127, #128) to detect the issue reported here. Hopefully that will help us avoid regression in future.