diff --git a/fsm.h b/fsm.h index 90c7a4d..5d4ae91 100644 --- a/fsm.h +++ b/fsm.h @@ -28,10 +28,10 @@ enum port_state { PS_LISTENING, PS_PRE_MASTER, PS_MASTER, - PS_GRAND_MASTER, PS_PASSIVE, PS_UNCALIBRATED, PS_SLAVE, + PS_GRAND_MASTER, /*non-standard extension*/ }; /** Defines the events for the port state machine. */ diff --git a/phc2sys.c b/phc2sys.c index 17d00db..8e6b79f 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -383,7 +383,6 @@ static int run_pmc(int wait_sync, int *utc_offset) switch (((struct portDS *)data)->portState) { case PS_MASTER: - case PS_GRAND_MASTER: case PS_SLAVE: ds_done = 1; break; diff --git a/port.c b/port.c index 6c9bd32..0112cb3 100644 --- a/port.c +++ b/port.c @@ -457,7 +457,11 @@ static int port_management_get_response(struct port *target, case PORT_DATA_SET: pds = (struct portDS *) tlv->data; pds->portIdentity = target->portIdentity; - pds->portState = target->state; + if (target->state == PS_GRAND_MASTER) { + pds->portState = PS_MASTER; + } else { + pds->portState = target->state; + } pds->logMinDelayReqInterval = target->logMinDelayReqInterval; pds->peerMeanPathDelay = target->peerMeanPathDelay; pds->logAnnounceInterval = target->logAnnounceInterval;