From owner-freebsd-mips@FreeBSD.ORG Mon Apr 20 01:00:57 2015 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66FFEAB4 for ; Mon, 20 Apr 2015 01:00:57 +0000 (UTC) Received: from mail-pd0-x230.google.com (mail-pd0-x230.google.com [IPv6:2607:f8b0:400e:c02::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37BF68BD for ; Mon, 20 Apr 2015 01:00:57 +0000 (UTC) Received: by pdea3 with SMTP id a3so190990039pde.3 for ; Sun, 19 Apr 2015 18:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=GlecROnuNGhiwLkl5PJDUIrdcyuP+Ntgod42EE2P5U0=; b=Es74f5eZqvisUi5PlsPlB0Fu3DGfGCSuK62z/DfWKCsajEDKn6quzgsdlQtmlXml8N cTrQBgRcMKnsyPV3S7LefxCv2ZPy/5gSzjNbbE7Z7nxEgo5Li0dypZ7R7l2Xb/0XAR0h vdlKLYzOPrWkEm+GFAKEtVDLxDKV9QGItxPSb5wIDHbg3JofikRrVFWeWFGz1tly4IKA NXgRqWVfZ/IU9KnYpf87sDTNaqWVlkXtccEN/mgTbsDi3RJX3JEND001lrrW1GKa2sxf uR4eB/yXJN4leK9GXGqdQ0jFYszTVqc0NQnTZ2wCBRsBJESFeZPlMiwA64OTWpIrQhKd AWXw== X-Received: by 10.68.224.69 with SMTP id ra5mr23414797pbc.161.1429491656762; Sun, 19 Apr 2015 18:00:56 -0700 (PDT) Received: from jarvis.local.gmail.com (c-24-130-233-249.hsd1.ca.comcast.net. [24.130.233.249]) by mx.google.com with ESMTPSA id bz11sm16306806pdb.34.2015.04.19.18.00.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Apr 2015 18:00:55 -0700 (PDT) From: Anmol Khirbat To: Wolfgang Zenker Cc: freebsd-mips@freebsd.org Subject: Re: Edge Router Lite: ntpd/ntpdate switch to 2050 References: <20150413130309.GA82425@lyxys.ka.sub.org> Date: Sun, 19 Apr 2015 18:00:53 -0700 In-Reply-To: <20150413130309.GA82425@lyxys.ka.sub.org> (Wolfgang Zenker's message of "Mon, 13 Apr 2015 15:03:09 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) MIME-Version: 1.0 Content-Type: text/plain 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: Mon, 20 Apr 2015 01:00:57 -0000 Wolfgang Zenker writes: > Hi, > > 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. root@:~ # uname -a FreeBSD 11.0-CURRENT FreeBSD 11.0-CURRENT #0 9cb51c3(master): Sun Apr 19 21:37:44 UTC 2015 anmol@fbsd8:/usr/home/anmol/obj/mips.mips64/usr/home/anmol/freebsd/sys/MALTA64 mips root@:~ # date Mon Apr 20 00:17:01 UTC 2015 root@:~ # /usr/sbin/ntpdate -v time.apple.com 20 Apr 00:17:07 ntpdate[678]: ntpdate 4.2.8p1-a (1) 6 Aug 08:04:48 ntpdate[678]: step time server 17.253.16.243 offset 205.523809 sec root@:~ # date Sat Aug 6 08:04:51 UTC 2050 # <<<<<===== 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 Regards, Anmol