send NOT_SUPPORTED errors for all unhandled, known management IDs

Now that there are clock/port_management_set functions, the IDs that
GETs are handled for, like DEFUALT_DATA_SET, still need to be in the
case for sending NOT_SUPPORTED errors.

Signed-off-by: Geoff Salmon <gsalmon@se-instruments.com>
master
Geoff Salmon 2013-02-04 13:05:40 -05:00 committed by Richard Cochran
parent 507bee9e73
commit 3921557672
2 changed files with 10 additions and 5 deletions

View File

@ -656,9 +656,7 @@ void clock_manage(struct clock *c, struct port *p, struct ptp_message *msg)
break; break;
case COMMAND: case COMMAND:
break; break;
case RESPONSE: default:
case ACKNOWLEDGE:
/* Ignore responses from other nodes. */
return; return;
} }
@ -669,6 +667,10 @@ void clock_manage(struct clock *c, struct port *p, struct ptp_message *msg)
case INITIALIZE: case INITIALIZE:
case FAULT_LOG: case FAULT_LOG:
case FAULT_LOG_RESET: case FAULT_LOG_RESET:
case DEFAULT_DATA_SET:
case CURRENT_DATA_SET:
case PARENT_DATA_SET:
case TIME_PROPERTIES_DATA_SET:
case PRIORITY1: case PRIORITY1:
case PRIORITY2: case PRIORITY2:
case DOMAIN: case DOMAIN:
@ -689,6 +691,7 @@ void clock_manage(struct clock *c, struct port *p, struct ptp_message *msg)
case ALTERNATE_TIME_OFFSET_PROPERTIES: case ALTERNATE_TIME_OFFSET_PROPERTIES:
case TRANSPARENT_CLOCK_DEFAULT_DATA_SET: case TRANSPARENT_CLOCK_DEFAULT_DATA_SET:
case PRIMARY_DOMAIN: case PRIMARY_DOMAIN:
case TIME_STATUS_NP:
clock_management_send_error(p, msg, NOT_SUPPORTED); clock_management_send_error(p, msg, NOT_SUPPORTED);
break; break;
default: default:

6
port.c
View File

@ -1714,13 +1714,15 @@ int port_manage(struct port *p, struct port *ingress, struct ptp_message *msg)
return 0; return 0;
break; break;
case COMMAND: case COMMAND:
case RESPONSE: break;
case ACKNOWLEDGE: default:
return -1; return -1;
} }
switch (mgt->id) { switch (mgt->id) {
case NULL_MANAGEMENT:
case CLOCK_DESCRIPTION: case CLOCK_DESCRIPTION:
case PORT_DATA_SET:
case LOG_ANNOUNCE_INTERVAL: case LOG_ANNOUNCE_INTERVAL:
case ANNOUNCE_RECEIPT_TIMEOUT: case ANNOUNCE_RECEIPT_TIMEOUT:
case LOG_SYNC_INTERVAL: case LOG_SYNC_INTERVAL: