dcavalca / rpms / linuxptp

Forked from rpms/linuxptp 2 years ago
Clone

Blame SOURCES/linuxptp-timeout.patch

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