]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Try marking structures as UNALIGNED.
authorGuy Harris <[email protected]>
Wed, 20 Sep 2017 08:37:35 +0000 (01:37 -0700)
committerGuy Harris <[email protected]>
Wed, 20 Sep 2017 08:37:35 +0000 (01:37 -0700)
See if this fixes the crashes on the OpenCSW SPARC buildbots.  If so, it
means that the compiler may think that even structures made up of
nothing but bytes (char/unsigned char) and arrays of bytes are aligned,
even if there's no guarantee of that.

(Bad compiler!  No biscuit!)

print-ntp.c

index 63a35091fe75af8a0a7e0108d1f6ac89214ea74a..ca455b2a93564c622bbdb6c1fe6fd6e4e838d3bb 100644 (file)
@@ -70,12 +70,12 @@ static const char tstr[] = " [|ntp]";
 struct l_fixedpt {
        nd_uint32_t int_part;
        nd_uint32_t fraction;
-};
+} UNALIGNED;
 
 struct s_fixedpt {
        nd_uint16_t int_part;
        nd_uint16_t fraction;
-};
+} UNALIGNED;
 
 /* rfc2030
  *                      1                   2                   3
@@ -135,7 +135,7 @@ struct ntp_time_data {
        struct l_fixedpt xmt_timestamp;
        nd_uint32_t key_id;
        nd_uint8_t  message_digest[20];
-};
+} UNALIGNED;
 /*
  *     Leap Second Codes (high order two bits)
  */
@@ -247,7 +247,7 @@ struct ntp_control_data {
        nd_uint16_t     offset;         /* Offset */
        nd_uint16_t     count;          /* Count */
        nd_uint8_t      data[564];      /* Data, [Padding, [Authenticator]] */
-};
+} UNALIGNED;
 
 /*
  * Print NTP time requests and responses