From: Dave Hart Date: Mon, 6 Aug 2012 04:22:39 +0000 (+0000) Subject: Attempt to resolve strict-aliasing violation in refclock_tsyncpci.c. X-Git-Tag: NTP_4_2_7P294~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a170cbc44947fcbbfb09aec8080131206f0cc692;p=thirdparty%2Fntp.git Attempt to resolve strict-aliasing violation in refclock_tsyncpci.c. Force prior config.cache files to be flushed due to [Bug 2242] fix invalidating getifaddrs() cached result. bk: 501f468fufvgVB9o9ajC4ENhi_h-cw --- diff --git a/ChangeLog b/ChangeLog index 84285f360..f99e79ada 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ * [Bug 2242] configure fails to detect getifaddrs function on Solaris. * [Bug 2249] Bad operator for 'test' in 'make check' of libevent. * [Bug 2252] palisade: formats nanosecs to a 6-char field. +* Attempt to resolve strict-aliasing violation in refclock_tsyncpci.c. (4.2.7p293) 2012/08/04 Released by Harlan Stenn * [Bug 2247] (more) Get rid of the TRAK refclock - deprecated since 2006. * Documentation cleanup from Mike T. diff --git a/configure.ac b/configure.ac index c7a1aec23..5bb0e22d5 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,7 @@ AC_PRESERVE_HELP_ORDER # the date YYYYMMDD optionally with -HHMM if there is more than one # bump in a day. -ntp_configure_cache_version=20110219 +ntp_configure_cache_version=20120806 # When the cache version of config.cache and configure do not # match, NTP_CACHEVERSION will flush the cache. diff --git a/ntpd/refclock_tsyncpci.c b/ntpd/refclock_tsyncpci.c index 61594f068..b203c3f0f 100644 --- a/ntpd/refclock_tsyncpci.c +++ b/ntpd/refclock_tsyncpci.c @@ -423,6 +423,7 @@ static void tsync_poll(int unit, struct peer *peer) ioctl_trans_di *it2; l_fp offset; l_fp ltemp; + ReferenceObj * pRefObj; /* Construct the device name */ @@ -552,9 +553,10 @@ static void tsync_poll(int unit, struct peer *peer) // Extract reference identifiers from ioctl payload memset(timeRef, '\0', sizeof(timeRef)); - memset(ppsRef, '\0', sizeof(ppsRef)); - memcpy(timeRef, ((ReferenceObj*)(it->payloads))->time, TSYNC_REF_LEN); - memcpy(ppsRef, ((ReferenceObj*)(it->payloads))->pps, TSYNC_REF_LEN); + memset(ppsRef, '\0', sizeof(ppsRef)); + pRefObj = (void *)it->payloads; + memcpy(timeRef, pRefObj->time, TSYNC_REF_LEN); + memcpy(ppsRef, pRefObj->pps, TSYNC_REF_LEN); // Extract the Clock Service Time Scale and convert to correct byte order memcpy(&tmscl, ((TIME_SCALE*)(it1->payloads)), sizeof(tmscl)); diff --git a/sntp/configure.ac b/sntp/configure.ac index 4f3e783f6..fd56544a7 100644 --- a/sntp/configure.ac +++ b/sntp/configure.ac @@ -32,7 +32,7 @@ AC_CONFIG_AUX_DIR([libevent/build-aux]) # the date YYYYMMDD optionally with -HHMM if there is more than one # bump in a day. -sntp_configure_cache_version=20110219 +sntp_configure_cache_version=20120806 # When the version of config.cache and configure do not # match, NTP_CACHEVERSION will flush the cache.