Hide the grandmaster port state.

There really is no such state, but there probably should have been one.
In any case, we do have one just to make the code simpler, but this should
not appear in the management responses. This patch fixes the issue by
covering over our tracks before sending a response.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2013-02-06 13:34:49 +01:00
parent 1e77af6d21
commit f530ae9333
3 changed files with 6 additions and 3 deletions

2
fsm.h
View File

@ -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. */

View File

@ -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;

6
port.c
View File

@ -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;