From owner-freebsd-mips@FreeBSD.ORG Tue Apr 21 22:45:07 2015 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E08AE64; Tue, 21 Apr 2015 22:45:07 +0000 (UTC) Received: from saturn.lyxys.ka.sub.org (saturn.lyxys.ka.sub.org [217.29.35.151]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2E50177C; Tue, 21 Apr 2015 22:45:06 +0000 (UTC) Received: from juno.lyxys.ka.sub.org (juno.lyx [IPv6:fd2a:89ca:7d54:0:240:caff:fe92:4f47]) by saturn.lyxys.ka.sub.org (8.14.9/8.14.9) with ESMTP id t3LMig7Z050655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 22 Apr 2015 00:44:42 +0200 (CEST) (envelope-from wolfgang@lyxys.ka.sub.org) Received: from juno.lyxys.ka.sub.org (localhost [127.0.0.1]) by juno.lyxys.ka.sub.org (8.14.9/8.14.9) with ESMTP id t3LMnxDs013985 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 22 Apr 2015 00:49:59 +0200 (CEST) (envelope-from wolfgang@lyxys.ka.sub.org) Received: (from wolfgang@localhost) by juno.lyxys.ka.sub.org (8.14.9/8.14.9/Submit) id t3LMnwAt013984; Wed, 22 Apr 2015 00:49:58 +0200 (CEST) (envelope-from wolfgang@lyxys.ka.sub.org) X-Authentication-Warning: juno.lyx: wolfgang set sender to wolfgang@lyxys.ka.sub.org using -f Date: Wed, 22 Apr 2015 00:49:58 +0200 From: Wolfgang Zenker To: freebsd-mips@freebsd.org Cc: glebius@FreeBSD.org Subject: Re: Edge Router Lite: ntpd/ntpdate switch to 2050 Message-ID: <20150421224958.GA13041@lyxys.ka.sub.org> References: <20150413130309.GA82425@lyxys.ka.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: private site User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (saturn.lyxys.ka.sub.org [IPv6:fd2a:89ca:7d54:1:200:24ff:feca:b4cc]); Wed, 22 Apr 2015 00:44:43 +0200 (CEST) X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2015 22:45:07 -0000 [Cc Gleb because he committed the current ntp/config.h] * Anmol Khirbat [150420 03:00]: > Wolfgang Zenker writes: >> not sure if this is platform related or a generic problem: After the >> recent ntpd update my Edge Router Lite running current has the problem >> that ntpd and ntpdate set the date/time to somewhere in 2050, but only >> if the offset of the system clock is larger than about 0.5 seconds. >> Currently running: >> FreeBSD pomona 11.0-CURRENT FreeBSD 11.0-CURRENT #0: Mon Apr 13 03:48:04 CEST 2015 wolfgang@pomona:/usr/obj/usr/src/sys/UBQTERL mips >> Problem happened with a few earlier versions after the new ntpd as well. > I think this is a problem on all big-endian systems. I tried mips, > mips64 and powerpc64 using Qemu. > [..] > Looks like usr.sbin/ntp/config.h is wrong. This seems to fix ntpdate. > I am not sure what a general fix for all possible architectures would look like. > diff --git a/usr.sbin/ntp/config.h b/usr.sbin/ntp/config.h > index b771834..a6ed749 100644 > --- a/usr.sbin/ntp/config.h > +++ b/usr.sbin/ntp/config.h > @@ -1586,7 +1586,7 @@ typedef unsigned int uintptr_t; > # endif > #else > # ifndef WORDS_BIGENDIAN > -/* # undef WORDS_BIGENDIAN */ > +# define WORDS_BIGENDIAN 1 > # endif > #endif I agree, running the configure script in /usr/src/contrib/ntp on a big-endian system produces a config.h that has the "# define WORDS_BIGENDIAN 1" line. Probably everyone expected the ntp sources to use the proper macros to convert between "network" and "host" byte order, in that case the ntp sources would not need to know about the endian-ness. But apparently that is not the case, so our pre-defined /usr/src/usr.sbin/ntp/config.h needs to have a mechanism to set WORDS_BIGENDIAN depending on the platform. Wolfgang