diff options
author | Miroslav Lichvar | 2017-09-01 06:41:41 -0500 |
---|---|---|
committer | Richard Cochran | 2017-09-01 08:44:59 -0500 |
commit | 17c9787b1d6891636b5be9e4e5a08278b44e9a7a (patch) | |
tree | 7f35b7d4140da3ceba0d94fe68f615caf7f379a3 | |
parent | 14a97dc5da47bd532f14109d7d381d5f33a77b0b (diff) | |
download | linuxptp-17c9787b1d6891636b5be9e4e5a08278b44e9a7a.tar.gz linuxptp-17c9787b1d6891636b5be9e4e5a08278b44e9a7a.tar.xz linuxptp-17c9787b1d6891636b5be9e4e5a08278b44e9a7a.zip |
phc2sys: fix handling of multiple state changes.
When the master clock changed its state and then changed it back to the
original state before phc2sys could process the first change, e.g. SLAVE
-> UNCALIBRATED -> SLAVE after a clockcheck failure, the second change
was ignored because the new value was the same as the original state,
which wasn't updated for the first change yet. This caused phc2sys to be
stuck with a wrong state.
Fix phc2sys to check both the state and new_state variables of the clock.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
-rw-r--r-- | phc2sys.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -786,7 +786,7 @@ static int recv_subscribed(struct node *node, struct ptp_message *msg, | |||
786 | port->state = state; | 786 | port->state = state; |
787 | clock = port->clock; | 787 | clock = port->clock; |
788 | state = clock_compute_state(node, clock); | 788 | state = clock_compute_state(node, clock); |
789 | if (clock->state != state) { | 789 | if (clock->state != state || clock->new_state) { |
790 | clock->new_state = state; | 790 | clock->new_state = state; |
791 | node->state_changed = 1; | 791 | node->state_changed = 1; |
792 | } | 792 | } |