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 <richardcoch...@gmail.com>
---
 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;
        }
-- 
2.20.1



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to