Skip to content

Commit

Permalink
Hide the grandmaster port state.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
richardcochran committed Feb 6, 2013
1 parent 1e77af6 commit f530ae9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fsm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
1 change: 0 additions & 1 deletion phc2sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion port.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f530ae9

Please sign in to comment.