[fabbione/kronosnet] 11a54d: ring: fix ping calculation for good

noreply at github.com noreply at github.com
Mon Nov 22 06:32:41 CET 2010


Branch: refs/heads/master
Home:   https://github.com/fabbione/kronosnet

Commit: 11a54d069bc0cae1656f040990dbbb9fb6ce1a07
    https://github.com/fabbione/kronosnet/commit/11a54d069bc0cae1656f040990dbbb9fb6ce1a07
Author: Fabio M. Di Nitto <fdinitto at redhat.com>
Date:   2010-11-21 (Sun, 21 Nov 2010)

Changed paths:
  M ring.c
  M ring.h
  M tests/ping_test.c

Log Message:
-----------
ring: fix ping calculation for good

finally I have been able to reproduce the problem and it's related to
the "unknown" source in MONOTONIC clock. It can rollover making the signed
comparison useless. Force unsigned long long for the calculation that
fixes the issue.

Switching from:
Notice: timediff: -345483470 interval: 1000000

To:
Notice: timediff: 18446744073387515858 interval: 1000000

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>




More information about the Commits mailing list