When the best port is changed, but the ID of the best clock doesn't
change (e.g. a passive port is activated on link failure), reset the
current delay and other master/link-specific state to avoid the switch
throwing the clock off.

Reviewed-by: Jacob Keller <jacob.e.kel...@intel.com>
Signed-off-by: Miroslav Lichvar <mlich...@redhat.com>
---
 clock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clock.c b/clock.c
index e545a9b..a073575 100644
--- a/clock.c
+++ b/clock.c
@@ -1947,7 +1947,7 @@ static void handle_state_decision_event(struct clock *c)
                          cid2str(&best_id));
        }
 
-       if (!cid_eq(&best_id, &c->best_id)) {
+       if (!cid_eq(&best_id, &c->best_id) || best != c->best) {
                clock_freq_est_reset(c);
                tsproc_reset(c->tsproc, 1);
                if (!tmv_is_zero(c->initial_delay))
-- 
2.26.3



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

Reply via email to