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 <richardcochran@gmail.com>
master
Richard Cochran 2013-03-07 18:00:01 +01:00
parent 48aa6712a9
commit 1ff9d0d0d2
1 changed files with 2 additions and 2 deletions

4
msg.c
View File

@ -32,9 +32,9 @@
#define VERSION 0x02 #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 { struct message_storage {
unsigned char reserved[MSG_HEADROOM]; unsigned char reserved[MSG_HEADROOM];