---
-* [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>
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
DTOLFP(clock_stat.fudgetime2, <mp);
HTONL_FP(<mp, &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);
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);