dcavalca / rpms / linuxptp

Forked from rpms/linuxptp 2 years ago
Clone

Blame SOURCES/linuxptp-timeout.patch

63054e
commit 241d8a064efa535029e28b87a8995add3cca8c0c
63054e
Author: Miroslav Lichvar <mlichvar@redhat.com>
63054e
Date:   Tue Sep 25 18:16:19 2018 +0200
63054e
63054e
    unicast: Process timeouts equal to current time.
63054e
    
63054e
    Don't postpone processing of a timeout if it is equal to the current
63054e
    time. This prevents an infinite loop with a simulated clock.
63054e
    
63054e
    Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
63054e
63054e
diff --git a/unicast_service.c b/unicast_service.c
63054e
index ad0e06a..9c9b95b 100644
63054e
--- a/unicast_service.c
63054e
+++ b/unicast_service.c
63054e
@@ -502,7 +502,7 @@ int unicast_service_timer(struct port *p)
63054e
 		pr_debug("peek i={2^%d} tmo={%ld,%ld}", interval->log_period,
63054e
 			 interval->tmo.tv_sec, interval->tmo.tv_nsec);
63054e
 
63054e
-		if (timespec_compare(&now, &interval->tmo) >= 0) {
63054e
+		if (timespec_compare(&now, &interval->tmo) > 0) {
63054e
 			break;
63054e
 		}
63054e
 		interval = pqueue_extract(p->unicast_service->queue);