Skip to content

ping: Warning: time of day goes back (-1429997080930663us), taking countermeasures #16

@xlz

Description

@xlz
xlz@zotac-zboxei750:~/src/net-next-nuse/arch/lib/tools$ sudo NUSECONF=nuse.conf ./nuse ping www.google.com
<5>Linux version 4.0.0+ (xlz@zotac-zboxei750) (gcc version 4.9.2 (Debian 4.9.2-10) ) #0 Thu May 7 02:03:30 EDT 2015
...
create vif eth0
  address = 192.168.1.10
  netmask = 255.255.255.0
  macaddr = 00:00:00:00:00:00
  type    = 0
mac address for eth0 is randomized 02:00:6f:d0:5d:3c
nuse syscall proxy start at unix:///tmp/rump-server-nuse.18368
PING www.google.com (74.125.196.147) 56(84) bytes of data.
Warning: time of day goes back (-1429997080928533us), taking countermeasures.
64 bytes from yk-in-f147.1e100.net (74.125.196.147): icmp_seq=1 ttl=46 time=44.5 ms
...

The cause is that timestamps obtained with SO_TIMESTAMP are from CLOCK_MONOTONIC (~986000 second) and are then compared with CLOCK_REALTIME timestamps from gettimeofday.

Changing CLOCK_MONOTONIC in nuse.c to CLOCK_REALTIME seems to suppress this warning, but it might not be the correct fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions