From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sat, 20 Mar 2021 09:13:52 +0000 (+0000) Subject: Stop using packed structures, increase the limit to 32 clocks. X-Git-Tag: 1.1-dev~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29e934a0f6633e0b3a41bc26802d65c6dcc9e8c8;p=thirdparty%2Fnqptp.git Stop using packed structures, increase the limit to 32 clocks. --- diff --git a/nqptp-shm-structures.h b/nqptp-shm-structures.h index 5d9d665..07350ba 100644 --- a/nqptp-shm-structures.h +++ b/nqptp-shm-structures.h @@ -20,26 +20,26 @@ #ifndef NQPTP_SHM_STRUCTURES_H #define NQPTP_SHM_STRUCTURES_H -#define MAX_SHARED_CLOCKS 8 +#define MAX_SHARED_CLOCKS 32 #define NQPTP_SHM_STRUCTURES_VERSION 1 #include #include #include -struct __attribute__((__packed__)) clock_source { - char ip[INET6_ADDRSTRLEN]; // where it's coming from - int flags; // not used yet - int valid; // this entry is valid +struct clock_source { + char ip[64]; // 64 is nicely aligned and bigger than INET6_ADDRSTRLEN (46) uint64_t source_time; // the time at the source at uint64_t local_time; // the local time when the source time is valid uint64_t local_to_source_time_offset; // add this to the local time to get source time + int flags; // not used yet + int valid; // this entry is valid }; -struct __attribute__((__packed__)) shm_basic_structure { +struct shm_basic_structure { }; -struct __attribute__((__packed__)) shm_structure { +struct shm_structure { pthread_mutex_t shm_mutex; // for safely accessing the structure uint16_t size_of_clock_array; // check this is equal to MAX_SHARED_CLOCKS uint16_t version; // check this is equal to NQPTP_SHM_STRUCTURES_VERSION