From 1ff9d0d0d25ddd3e722934a224fa88dc43446c91 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Thu, 7 Mar 2013 18:00:01 +0100 Subject: [PATCH] Align the message buffer to eight bytes. The 'struct ptp_message" includes a 64 bit integer field, ts.pdu.sec, and this must be aligned to an eight byte boundary for armv5 machines. Although the compiler puts the field at the right offset, we spoil this by packing the struct with 20 bytes of head room. This patch fixes the issue by realigning the message buffer. Signed-off-by: Richard Cochran --- msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msg.c b/msg.c index 8fd2008..eefd359 100644 --- a/msg.c +++ b/msg.c @@ -32,9 +32,9 @@ #define VERSION 0x02 /* - * Head room fits a VLAN Ethernet header, and 'msg' is 32 bit aligned. + * Head room fits a VLAN Ethernet header, and 'msg' is 64 bit aligned. */ -#define MSG_HEADROOM 20 +#define MSG_HEADROOM 24 struct message_storage { unsigned char reserved[MSG_HEADROOM];