fping icon indicating copy to clipboard operation
fping copied to clipboard

setting SO_TIMESTAMPNS option: Protocol not available (on debian running in docker container)

Open rolf-d2i opened this issue 2 years ago • 16 comments

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.

rolf-d2i avatar Apr 11 '23 14:04 rolf-d2i

I think it is the same problem as #272

gsnw avatar Apr 15 '23 08:04 gsnw

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?

rolf-d2i avatar Apr 17 '23 06:04 rolf-d2i

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.

gsnw avatar Apr 17 '23 15:04 gsnw

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.

rolf-d2i avatar Apr 18 '23 06:04 rolf-d2i

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.

gsnw avatar Apr 21 '23 20:04 gsnw

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

rolf-d2i avatar Apr 24 '23 08:04 rolf-d2i

Editing config.h manually in the source code and setting SO_TIMESTAMPNS 0 in file removes the "protocol not available" printouts in terminal.

rolf-d2i avatar Apr 24 '23 08:04 rolf-d2i

You can use ./configure --disable-timestamp, this "Disable kernel-based packet timestaping (SO_TIMESTAMPNS)"

gsnw avatar Apr 24 '23 16:04 gsnw

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.

rolf-d2i avatar Apr 25 '23 06:04 rolf-d2i

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.

gsnw avatar Apr 30 '23 06:04 gsnw

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

rolf-d2i avatar May 02 '23 08:05 rolf-d2i

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.

hmh avatar May 03 '23 13:05 hmh

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.

gsnw avatar Aug 19 '23 18:08 gsnw

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

gsnw avatar Aug 19 '23 20:08 gsnw

Tested ./fping www.di.se after compiling and got output www.di.se is alive Looks like the issue is fixed.

rolf-d2i avatar Aug 22 '23 08:08 rolf-d2i

Fixed with pull request #279

gsnw avatar Aug 22 '23 18:08 gsnw

@schweikert The issue can be closed as solved

gsnw avatar Apr 19 '24 13:04 gsnw