From 467552d1cbc8c7e08c4684e2092f95e874b33218 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Tue, 31 Mar 2020 11:53:13 -0700 Subject: [PATCH] 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 --- clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clock.c b/clock.c index 6f9cc21..b928f56 100644 --- a/clock.c +++ b/clock.c @@ -442,6 +442,7 @@ static int clock_management_fill_response(struct clock *c, struct port *p, } sen = (struct subscribe_events_np *)tlv->data; clock_get_subscription(c, req, sen->bitmask, &sen->duration); + datalen = sizeof(*sen); break; default: /* The caller should *not* respond to this message. */ @@ -513,8 +514,7 @@ static int clock_management_set(struct clock *c, struct port *p, break; case TLV_SUBSCRIBE_EVENTS_NP: sen = (struct subscribe_events_np *)tlv->data; - clock_update_subscription(c, req, sen->bitmask, - sen->duration); + clock_update_subscription(c, req, sen->bitmask, sen->duration); respond = 1; break; }