From 52c5e0cfc972c3e2b65ca492eecbff6edb8b2aaf Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 11 Oct 2013 17:30:29 +0200 Subject: [PATCH] Don't calculate delay with old master's sync time stamp. When a new master is selected, drop the old sync time stamp to prevent calculating invalid delay in case delay_resp will be received before first sync from the new master. Signed-off-by: Miroslav Lichvar --- clock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clock.c b/clock.c index cf65fff..819421e 100644 --- a/clock.c +++ b/clock.c @@ -1155,6 +1155,8 @@ static void handle_state_decision_event(struct clock *c) if (!cid_eq(&best_id, &c->best_id)) { clock_freq_est_reset(c); mave_reset(c->avg_delay); + c->t1 = tmv_zero(); + c->t2 = tmv_zero(); c->path_delay = 0; fresh_best = 1; }