]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
bug3527 fixes
authorHarlan Stenn <stenn@ntp.org>
Sat, 15 Dec 2018 13:25:25 +0000 (13:25 +0000)
committerHarlan Stenn <stenn@ntp.org>
Sat, 15 Dec 2018 13:25:25 +0000 (13:25 +0000)
bk: 5c1500c5QLnqoQQT-5W9KHQoqOytzw

ChangeLog
configure.ac
ntpd/ntp_request.c
ntpdc/ntpdc_ops.c

index 87e6950614e0be2b8adbb198e3381701ea980d1d..514585f03a49b5458dd01b7b8a827b303b645d0a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
 ---
-* [Bug 3527] fudgeval2 anomaly in mode7 clock info packet <perlinger@ntp.org>
-  - Found by Gerry Garvey. Can't be fixed without causing serious interop
-    issues. Left a comment to fix this in protocol version 5.
+* [Bug 3527 - Backward Incompatible] mode7 clockinfo fudgeval2 anomaly
+  packet <perlinger@ntp.org>, reported by GGarvey.
+  - --enable-bug3527-fix support by HStenn
 
 ---
 (4.2.8p12) 2018/08/14 Released by Harlan Stenn <stenn@ntp.org>
index 1f477c51418823e33d3a77cee0ff6dcf1e1992f9..c2e5431d17f4993c8c5d42a199a8db23d7c42191 100644 (file)
@@ -4194,6 +4194,24 @@ case "$ans" in
 esac
 
 
+AC_MSG_CHECKING([if we want correct mode7 fudgetime2 behavior])
+AC_ARG_ENABLE(
+    [bug3527-fix],
+    [AS_HELP_STRING(
+       [--enable-bug3527-fix],
+       [+ provide correct mode7 fudgetime2 behavior]
+    )],
+    [ans=$enableval],
+    [ans=yes]
+)
+AC_MSG_RESULT([$ans])
+case "$ans" in
+ no)
+    AC_DEFINE([DISABLE_BUG3527_FIX], [1],
+       [use old autokey session key behavior?])
+esac
+
+
 AC_MSG_CHECKING([if we should use the IRIG sawtooth filter])
 
 case "$host" in
index 408a0f51d987fc290126a1e8bf3102c882232229..53585088a67f6392989a69d46c2fc91ce0de7970 100644 (file)
@@ -2536,12 +2536,15 @@ get_clock_info(
                DTOLFP(clock_stat.fudgetime2, &ltmp);
                HTONL_FP(&ltmp, &ic->fudgetime2);
                ic->fudgeval1 = htonl((u_int32)clock_stat.fudgeval1);
-               /* [Bug3527] ist still there: ic->fudgeval2 is effectively
-                * host order here, since clockstat.fudgeval2 is already
-                * in network byte order! Needs fixing the whole chain,
-                * possibly in NTP protocol v5...
+               /* [Bug3527] Backward Incompatible: ic->fudgeval2 is
+                * a string, instantiated via memcpy() so there is no
+                * endian issue to correct.
                 */
+#ifdef DISABLE_BUG3527_FIX
                ic->fudgeval2 = htonl(clock_stat.fudgeval2);
+#else
+               ic->fudgeval2 = clock_stat.fudgeval2;
+#endif
 
                free_varlist(clock_stat.kv_list);
 
index 9c60c30a2507b9c4e31ee6f8e132652ee56b4208..da2bdc86da490ee2c002aa3d123c13038c9cdb6b 100644 (file)
@@ -2713,12 +2713,17 @@ again:
                               lfptoa(&ts, 6));
                (void) fprintf(fp, "stratum:              %ld\n",
                               (u_long)ntohl(cl->fudgeval1));
-               /* [Bug3527] ist still there: fudgeval2 is effectively
-                * host order here. Needs fixing the whole chain,
-                * possibly in NTP protocol v5...
+               /* [Bug3527] Backward Incompatible: cl->fudgeval2 is
+                * a string, instantiated via memcpy() so there is no
+                * endian issue to correct.
                 */
+#ifdef DISABLE_BUG3527_FIX
                (void) fprintf(fp, "reference ID:         %s\n",
                               refid_string(ntohl(cl->fudgeval2), 0));
+#else
+               (void) fprintf(fp, "reference ID:         %s\n",
+                              refid_string(cl->fudgeval2, 0));
+#endif
                (void) fprintf(fp, "fudge flags:          0x%x\n",
                               cl->flags);