dcavalca / rpms / linuxptp

Forked from rpms/linuxptp 2 years ago
Clone

Blame SOURCES/linuxptp-timeout.patch

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