From 98336b28110c47fdb6567e5541cc39a9969cf7f3 Mon Sep 17 00:00:00 2001 From: Mario Paja Date: Tue, 19 Dec 2023 12:16:49 +0100 Subject: [PATCH] Revert "net: gptp: Fix announce message len" This reverts commit 6b644dff676e56e1402e72db8efe121c1d6b5b43. Reason: breaks Peer-to-Peer gPTP connection. A better solution should be found to handle the optional TLV on the announce message (chapter 10.5.1 IEEE 802.1AS-2011) Signed-off-by: Mario Paja --- subsys/net/l2/ethernet/gptp/gptp_messages.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/l2/ethernet/gptp/gptp_messages.h b/subsys/net/l2/ethernet/gptp/gptp_messages.h index 38c4f60349cbac..35c5fea27986e5 100644 --- a/subsys/net/l2/ethernet/gptp/gptp_messages.h +++ b/subsys/net/l2/ethernet/gptp/gptp_messages.h @@ -68,7 +68,7 @@ extern "C" { #define GPTP_ANNOUNCE_LEN(pkt) \ (sizeof(struct gptp_hdr) + sizeof(struct gptp_announce) \ + ntohs(GPTP_ANNOUNCE(pkt)->tlv.len) \ - - sizeof(struct gptp_path_trace_tlv)) + - sizeof(struct gptp_path_trace_tlv) + 4) #define GPTP_CHECK_LEN(pkt, len) \ ((GPTP_PACKET_LEN(pkt) != len) && (GPTP_VALID_LEN(pkt, len)))