phc2sys: fix overwriting of the clock state

The reconfigure function is missing a check whether state for the given
clock actually changed or not. This caused state for all unchanged ports to
be zeroed.

Reported-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
master
Jiri Benc 2014-11-13 18:18:12 +01:00 committed by Richard Cochran
parent 7144aa9263
commit 7455c24148
1 changed files with 6 additions and 4 deletions

View File

@ -305,11 +305,13 @@ static void reconfigure(struct node *node)
continue; continue;
} }
if (c->new_state == PS_MASTER) if (c->new_state) {
clock_reinit(c); if (c->new_state == PS_MASTER)
clock_reinit(c);
c->state = c->new_state; c->state = c->new_state;
c->new_state = 0; c->new_state = 0;
}
if (c->state == PS_SLAVE) { if (c->state == PS_SLAVE) {
src = c; src = c;