[Git][NTPsec/ntpsec][master] Make --enable-classic-mode re-enable old-style config for generic driver.

Eric S. Raymond gitlab at mg.gitlab.com
Thu Jul 7 14:22:00 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
a3852f0c by Eric S. Raymond at 2016-07-07T10:20:01-04:00
Make --enable-classic-mode re-enable old-style config for generic driver.

- - - - -


4 changed files:

- INSTALL
- docs/driver_generic.txt
- docs/index.txt
- ntpd/refclock_generic.c


Changes:

=====================================
INSTALL
=====================================
--- a/INSTALL
+++ b/INSTALL
@@ -155,6 +155,10 @@ Here's what it presently does:
 * Reverts logging to the old format that designates clocks with magic
   addresses rather than the driver shortname and unit number.
 
+* Enables declaring generic-driver refclocks with the old magic-address
+  syntax (but the new syntax won't work for these, though it will for
+  other driver types).
+
 Other behaviors may be added in future releases.
 
 == Uninstalled binaries and scripts ==


=====================================
docs/driver_generic.txt
=====================================
--- a/docs/driver_generic.txt
+++ b/docs/driver_generic.txt
@@ -78,8 +78,9 @@ and any number of these clocks may be operational at any one time.
 
 Note: In {project-shortname}, you _must_ use the new configuration
 syntax (refclock generic subtype N) to declare generic clocks, rather
-than the old-style syntax with a magic address. We apologize for
-the inconvenience.
+than the old-style syntax with a magic address, unless the software
+has been built with the --enable-classic-mode option in which case
+*only* the old-style syntax will work.
 
 A note on the implementations:
 


=====================================
docs/index.txt
=====================================
--- a/docs/index.txt
+++ b/docs/index.txt
@@ -141,7 +141,8 @@ few will be user-visible.
   the maximum number of units that can be set up changes from 4
   (numbers 0-3) to unlimited.  However, the old magic-address syntax
   will not work correctly - you _must_ use the new syntax to declare
-  generic-driver refclocks.
+  generic-driver refclocks.  If the software was compiled with the
+  --enable-classic-mode switch, the foregoing is reversed.
 
 * The +sntp+ program has been renamed +{ntpdig}+ in order to make
   NTP installables have a uniform name prefix and take up less
@@ -171,8 +172,8 @@ few will be user-visible.
 
 * The shortname of --help options is now -h, not -?
 
-* An instance of {ntpq} built from the {project-shortname} code
-  querying a legacy NTP daemons will not automatically display
+* An instance of +{ntpq}+ built from the {project-shortname} code
+  querying a legacy NTP daemon will not automatically display
   peers with 127.127.127.t.u addresses as refclocks; that assumption
   has been removed from the {project-shortname} code as part of
   getting it fully IPv6-ready.


=====================================
ntpd/refclock_generic.c
=====================================
--- a/ntpd/refclock_generic.c
+++ b/ntpd/refclock_generic.c
@@ -2540,6 +2540,11 @@ parse_start(
 		notice = 1;
 	}
 
+#ifdef ENABLE_CLASSIC_MODE
+	peer->ttl = (peer->refclkunit & ~0x80) >> 2;
+	peer->refclkunit = peer->refclkunit & 0x03;
+#endif /* ENABLE_CLASSIC_MODE */
+
 	type = CLK_TYPE(peer);
 	unit = peer->refclkunit;
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/a3852f0cca660a908d18157694d607bb2b3f59b0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160707/9a315f80/attachment.html>


More information about the vc mailing list