Edge Router Lite: ntpd/ntpdate switch to 2050
Anmol Khirbat
khirbat at gmail.com
Mon Apr 20 01:00:57 UTC 2015
Wolfgang Zenker <wolfgang at lyxys.ka.sub.org> 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 at 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 at 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
More information about the freebsd-mips
mailing list