From: Miroslav Lichvar Date: Thu, 23 Feb 2017 14:42:55 +0000 (+0100) Subject: chrony: add padding to IPAddr struct X-Git-Tag: collectd-5.8.0~172^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2273f46eae4a0e4c8889fa03ecb38001af5f19f1;p=collectd.git chrony: add padding to IPAddr struct Since the IPAddr struct is declared with the packed attribute and contains a 32-bit field, it needs to include a 16-bit padding in order to be aligned to 32 bits. --- diff --git a/src/chrony.c b/src/chrony.c index 835c4253..a4dd59f8 100644 --- a/src/chrony.c +++ b/src/chrony.c @@ -186,13 +186,11 @@ typedef struct ATTRIB_PACKED { uint8_t ip6[16]; } addr; uint16_t f_family; + uint16_t padding; } tChrony_IPAddr; typedef struct ATTRIB_PACKED { tChrony_IPAddr addr; - uint16_t - dummy; /* FIXME: Strange dummy space. Needed on gcc 4.8.3/clang 3.4.1 on - x86_64 */ int16_t f_poll; /* 2^f_poll = Time between polls (s) */ uint16_t f_stratum; /* Remote clock stratum */ uint16_t f_state; /* 0 = RPY_SD_ST_SYNC, 1 = RPY_SD_ST_UNREACH, 2 = @@ -213,9 +211,6 @@ typedef struct ATTRIB_PACKED { typedef struct ATTRIB_PACKED { uint32_t f_ref_id; tChrony_IPAddr addr; - uint16_t - dummy; /* FIXME: Strange dummy space. Needed on gcc 4.8.3/clang 3.4.1 on - x86_64 */ uint32_t f_n_samples; /* Number of measurements done */ uint32_t f_n_runs; /* How many measurements to come */ uint32_t f_span_seconds; /* For how long we're measuring */ @@ -230,9 +225,6 @@ typedef struct ATTRIB_PACKED { typedef struct ATTRIB_PACKED { uint32_t f_ref_id; tChrony_IPAddr addr; - uint16_t - dummy; /* FIXME: Strange dummy space. Needed on gcc 4.8.3/clang 3.4.1 on - x86_64 */ uint16_t f_stratum; uint16_t f_leap_status; tTimeval f_ref_time;