From 85cebe02657478b8c91d4b94a79e1d7f16d9fda3 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 21 Feb 2014 11:08:33 +0100 Subject: [PATCH] Fix conversion of cumulativeScaledRateOffset in TIME_STATUS_NP. This fixes reporting of negative offsets. Signed-off-by: Miroslav Lichvar --- clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clock.c b/clock.c index c3baa87..8d512ca 100644 --- a/clock.c +++ b/clock.c @@ -266,7 +266,7 @@ static int clock_management_get_response(struct clock *c, struct port *p, tsn->master_offset = c->master_offset; tsn->ingress_time = tmv_to_nanoseconds(c->t2); tsn->cumulativeScaledRateOffset = - (UInteger32) (c->status.cumulativeScaledRateOffset + + (Integer32) (c->status.cumulativeScaledRateOffset + c->nrr * POW2_41 - POW2_41); tsn->scaledLastGmPhaseChange = c->status.scaledLastGmPhaseChange; tsn->gmTimeBaseIndicator = c->status.gmTimeBaseIndicator;