On Wed, Mar 10, 2021 at 03:25:18PM +0100, Miroslav Lichvar wrote: > @@ -37,7 +38,7 @@ int assume_two_step = 0; > struct message_storage { > unsigned char reserved[MSG_HEADROOM]; > struct ptp_message msg; > -} PACKED; > +};
Is there a better way? How about dropping PACKED but adding an alignment attribute on 'msg'? We don't about extra padding between 'reserved' and 'msg'. > @@ -267,6 +268,10 @@ struct ptp_message *msg_allocate(void) > pool_stats.total++; > pool_debug("allocate", m); > } > + if (sizeof(s->reserved) + sizeof(s->msg) != sizeof(*s)) { > + pr_err("unexpected alignment"); > + exit(1); > + } This is clunky. If we really _must_ have it, then it should be a one time check (msg_init()?) and not every time a message is allocated. But I would prefer avoiding this altogether. Thanks, Richard _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel