-
Notifications
You must be signed in to change notification settings - Fork 252
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
When falling back to SO_TIMESTAMP reply timestamp is probably not working #374
Comments
Thanks for the report! There seems to be code missing to handle non-nanosecond timestamps. Only nanosecond resolution timestamp messages are handled: Lines 2104 to 2117 in cb83286
According to the socket(7) man page, the fall back to |
Commit e866063 added a fallback from setting the socket option SO_TIMESTAMPNS to setting the socket option SO_TIMESTAMP if the nanosecond timestamp option could not be set. But it did not add code to also look for the control message related to SO_TIMESTAMP. Thus microsecond timestamps were requested, but not read. This commit adds the missing code to read microsecond timestamp control messages. The problem was reported in GitHub issue schweikert#374 by @payload.
Commit e866063 added a fallback from setting the socket option SO_TIMESTAMPNS to setting the socket option SO_TIMESTAMP if the nanosecond timestamp option could not be set. But it did not add code to also look for the control message related to SO_TIMESTAMP. Thus microsecond timestamps were requested, but not read. This commit adds the missing code to read microsecond timestamp control messages. The problem was reported in GitHub issue #374 by @payload.
I noticed in this commit
e866063#commitcomment-151310711
that when fping can't setsockopt SO_TIMESTAMPNS it falls back to SO_TIMESTAMP. But the reading of the cmsg data is not considering this fallback. In that case no timestamp would be read. I think the fallback is not completely implemented. In that case the reply time is still coming from this line
fping/src/fping.c
Line 2454 in cb83286
Relevant documentation: https://docs.kernel.org/networking/timestamping.html
The text was updated successfully, but these errors were encountered: