clock: Reply with correct payload length for SUBSCRIBE_EVENTS_NP queries.

The clock layer indeed replies to management GET actions for this item,
but it sends an empty management message by mistake.  This patch fixes the
issue by replying with a payload of the correct length.

While we are at it, correct overly zealous line breaking according to our
coding style.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2020-03-31 11:53:13 -07:00
parent b829580a33
commit 467552d1cb
1 changed files with 2 additions and 2 deletions

View File

@ -442,6 +442,7 @@ static int clock_management_fill_response(struct clock *c, struct port *p,
} }
sen = (struct subscribe_events_np *)tlv->data; sen = (struct subscribe_events_np *)tlv->data;
clock_get_subscription(c, req, sen->bitmask, &sen->duration); clock_get_subscription(c, req, sen->bitmask, &sen->duration);
datalen = sizeof(*sen);
break; break;
default: default:
/* The caller should *not* respond to this message. */ /* The caller should *not* respond to this message. */
@ -513,8 +514,7 @@ static int clock_management_set(struct clock *c, struct port *p,
break; break;
case TLV_SUBSCRIBE_EVENTS_NP: case TLV_SUBSCRIBE_EVENTS_NP:
sen = (struct subscribe_events_np *)tlv->data; sen = (struct subscribe_events_np *)tlv->data;
clock_update_subscription(c, req, sen->bitmask, clock_update_subscription(c, req, sen->bitmask, sen->duration);
sen->duration);
respond = 1; respond = 1;
break; break;
} }