Skip to content
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

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

Open
xlz opened this issue May 7, 2015 · 1 comment

Comments

@xlz
Copy link

xlz commented May 7, 2015

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.

@thehajime
Copy link
Member

great catch.

since nuse_current_ns() is the source of jiffies, used by Linux kernel part, I intended to use CLOCK_MONOTONIC to avoid discontinuous time jump.

I would really like to see how this issue can be solved transparently but didn't come up with the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants