schweikert / fping

High performance ping tool

Home Page:https://fping.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bogus values for -D if SO_TIMESTAMPNS is unavailable

sthen opened this issue · comments

If the OS doesn't have SO_TIMESTAMPNS then fping chooses CLOCK_MONOTONIC for its timer if available. This results in bogus values for timestamps with fping -D as it uses an uptime-based clock rather than realtime.

$ fping -D -c1 127.0.0.1 2> /dev/null             
[596040.03537] 127.0.0.1 : [0], 64 bytes, 0.122 ms (0.122 avg, 0% loss)

This was introduced in 754a21e (

#define CLOCKID CLOCK_MONOTONIC
) when SO_TIMESTAMP was replaced with SO_TIMESTAMPNS.

Oh, this is a duplicate of #203