Don't postpone processing of a timeout if it is equal to the current
time. This prevents an infinite loop with a simulated clock.

Signed-off-by: Miroslav Lichvar <mlich...@redhat.com>
---
 unicast_service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unicast_service.c b/unicast_service.c
index ad0e06a..9c9b95b 100644
--- a/unicast_service.c
+++ b/unicast_service.c
@@ -502,7 +502,7 @@ int unicast_service_timer(struct port *p)
                pr_debug("peek i={2^%d} tmo={%ld,%ld}", interval->log_period,
                         interval->tmo.tv_sec, interval->tmo.tv_nsec);
 
-               if (timespec_compare(&now, &interval->tmo) >= 0) {
+               if (timespec_compare(&now, &interval->tmo) > 0) {
                        break;
                }
                interval = pqueue_extract(p->unicast_service->queue);
-- 
2.17.1



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to