From 3921557672dda12615d0b5c0196a70f509f73d68 Mon Sep 17 00:00:00 2001 From: Geoff Salmon Date: Mon, 4 Feb 2013 13:05:40 -0500 Subject: [PATCH] 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 --- clock.c | 9 ++++++--- port.c | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/clock.c b/clock.c index 3f0cf69..ca66bf6 100644 --- a/clock.c +++ b/clock.c @@ -656,9 +656,7 @@ void clock_manage(struct clock *c, struct port *p, struct ptp_message *msg) break; case COMMAND: break; - case RESPONSE: - case ACKNOWLEDGE: - /* Ignore responses from other nodes. */ + default: return; } @@ -669,6 +667,10 @@ void clock_manage(struct clock *c, struct port *p, struct ptp_message *msg) case INITIALIZE: case FAULT_LOG: case FAULT_LOG_RESET: + case DEFAULT_DATA_SET: + case CURRENT_DATA_SET: + case PARENT_DATA_SET: + case TIME_PROPERTIES_DATA_SET: case PRIORITY1: case PRIORITY2: 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 TRANSPARENT_CLOCK_DEFAULT_DATA_SET: case PRIMARY_DOMAIN: + case TIME_STATUS_NP: clock_management_send_error(p, msg, NOT_SUPPORTED); break; default: diff --git a/port.c b/port.c index 0403366..4f4641c 100644 --- a/port.c +++ b/port.c @@ -1714,13 +1714,15 @@ int port_manage(struct port *p, struct port *ingress, struct ptp_message *msg) return 0; break; case COMMAND: - case RESPONSE: - case ACKNOWLEDGE: + break; + default: return -1; } switch (mgt->id) { + case NULL_MANAGEMENT: case CLOCK_DESCRIPTION: + case PORT_DATA_SET: case LOG_ANNOUNCE_INTERVAL: case ANNOUNCE_RECEIPT_TIMEOUT: case LOG_SYNC_INTERVAL: