Skip to content

Commit

Permalink
clock: Don't allow COMMAND action on non-UDS port.
Browse files Browse the repository at this point in the history
No COMMAND actions are currently supported, but check the port early in
clock_manage() before reaching port_manage().

Signed-off-by: Miroslav Lichvar <[email protected]>
  • Loading branch information
mlichvar authored and richardcochran committed Feb 13, 2021
1 parent 1e2b63c commit 942cf52
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,11 @@ int clock_manage(struct clock *c, struct port *p, struct ptp_message *msg)
return changed;
break;
case COMMAND:
if (p != c->uds_port) {
/* Sorry, only allowed on the UDS port. */
clock_management_send_error(p, msg, TLV_NOT_SUPPORTED);
return changed;
}
break;
default:
return changed;
Expand Down

0 comments on commit 942cf52

Please sign in to comment.