setting SO_TIMESTAMPNS option: Protocol not available (on debian running in docker container)
When running fping 5.1 in a docker container on MacOSX Ventura 13.0 in emulated amd64 mode on apple silicon I got
fping setting SO_TIMESTAMPNS option: Protocol not available setting SO_TIMESTAMPNS option (IPv6): Protocol not available
The error can be fixed by downgrading fping to for instance the 4.2 version by downloaded fping package from debian package site and installing the old package using dpkg. Running fping 5.0 in a native debian docker container on apple silicon works as expected (currently latest version). Both the arm and amd64 debian versions were 11.6.
I think it is the same problem as #272
It may be the same issue but the previous error was specific to windows server and WSL1 and is therefore Windows specific problem. Issue #272 should perhaps be rewritten to include every instance of operating system machine combination that has encountered the same issue?
SO_TIMESTAMPNS exists since fping 5.0 fping 4.3 works because it is not present there.
When building the lates version it is checked if "SO_TIMESTAMPNS" is set on the system. The package builders of the distributions apparently use a kernel where this is present. If now this package is installed on a system e.g. amd64, where a different kernel is present, which does not support "SO_TIMESTAMPNS", then it should come to this message.
This is probably the same for Microsoft with WSL.
The amd64 emulation on MacOSX lacks support for some vector instructions on amd64/intel cpus and possible is missing some other cpu instructions. The kernal is supposed to be a standard debian linux kernal that can run on any amd64 processor., I doubt the issue here is the kernal itself.
Can you build https://github.com/gsnw/fping/tree/issue/272-273 and check this? I have add a runtime check for SO_TIMESTAMPNS with fallback to SO_TIMESTAMP
I hope this help and works.
After building root@f74a2b206ad3:~/fping# /usr/local/sbin/fping -v /usr/local/sbin/fping: Version 5.1 root@f74a2b206ad3:~/fping# /usr/local/sbin/fping www.google.se setting SO_TIMESTAMPNS option: Protocol not available setting SO_TIMESTAMPNS option (IPv6): Protocol not available www.google.se is alive
Still the same issue
Editing config.h manually in the source code and setting SO_TIMESTAMPNS 0 in file removes the "protocol not available" printouts in terminal.
You can use ./configure --disable-timestamp, this "Disable kernel-based packet timestaping (SO_TIMESTAMPNS)"
Best if this gets patched for runtime. Is there a configure file for fping to customise runtime behaviour to turn the timestamp off? This could be a temporary fix to help certain software like zabbix to run on some platforms without downgrading fping. It would also help with debugging fping issues.
Please check again https://github.com/gsnw/fping/tree/issue/272-273. I had an error in my first version. Have it now the check at runtime again built. I hope it works, but unfortunately I can't test it, because I don't have a system where SO_TIMESTAMPNS is not supported.
Still the same issue, also I checked with ethtool that supposedly can detect device features, but I could not find any information using ethtool for the virtual device. Do note that there is ping request including error messages when running, silently ignoring the error might work for most applications using fping.
>> /usr/local/sbin/fping www.di.se setting SO_TIMESTAMPNS option: Protocol not available setting SO_TIMESTAMPNS option (IPv6): Protocol not available www.di.se is alive
In Linux, SO_TIMESTAMP versus SO_TIMESTAMPNS is a question of libc version, kernel version, and other $random factors such as syscall filtering (seccomp filters), POSIX capabilities, or other runtime factors.
The most UX-friendly way would be to try SO_TIMESTAMPNS, if that fails (and the code can work with it) SO_TIMESTAMP, and if that fails, proceed without that (probably timestamping with less precision directly after send/receive).
And yes, that can be a silent deal, or a debug-mode messages deal. There is no reason to pester the user with these details unless in debug mode.
Sorry for the late reply. I was looking for a way to reproduce the message. Unfortunately I couldn't do it under Debian Docker. But now I have Windows 10 running in a VM and WSL1 installed and I can reproduce the message.
Can you please check again https://github.com/gsnw/fping/tree/issue/272-273 I have add fallback to SO_TIMESTAMP. If both do not work, fping is not usable from my point of view
Tested ./fping www.di.se after compiling and got output www.di.se is alive Looks like the issue is fixed.
Fixed with pull request #279
@schweikert The issue can be closed as solved