]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1670] Fix peer->bias and broadcastdelay
authorHarlan Stenn <stenn@ntp.org>
Fri, 22 Oct 2010 05:56:16 +0000 (01:56 -0400)
committerHarlan Stenn <stenn@ntp.org>
Fri, 22 Oct 2010 05:56:16 +0000 (01:56 -0400)
bk: 4cc12780fGDDck-mqpB0XRzrglDP3w

ChangeLog
html/miscopt.html
include/ntp.h
ntpd/ntp_proto.c

index 557cd412bcc2319c47bb65cfc9b19e7d19df2669..ba0f0e1efaaf5234b26b1595d6688d0b861f5feb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 * [Bug 1669] from 4.2.6p3-RC5: NTP fails to compile on IBM AIX 5.3.
+* [Bug 1670] Fix peer->bias and broadcastdelay.
 * Documentation updates from Dave Mills.
 * Documentation EOL cleanup.
 (4.2.7p67) 2010/10/21 Released by Harlan Stenn <stenn@ntp.org>
index 086521594870d2ca3c5749c1f0fc66829e666aec..2f44eeea8487e2a01ad583da748ab94461c07f68 100644 (file)
@@ -10,7 +10,7 @@
 <img src="pic/boom3.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
 <p>We have three, now looking for more.</p>
 <p>Last update:
-  <!-- #BeginDate format:En2m -->21-Sep-2010  20:48<!-- #EndDate -->
+  <!-- #BeginDate format:En2m -->22-Oct-2010  5:31<!-- #EndDate -->
   UTC</p>
 <br clear="left">
 <h4>Related Links</h4>
@@ -19,8 +19,9 @@
 <hr>
 <h4>Commands and Options</h4>
 <dl>
-  <dt id="broadcastdelay"><tt>broadcastdelay <i>seconds</i></tt></dt>
-  <dd>The broadcast and multicast modes require a special calibration to determine the network delay between the local and remote servers. Ordinarily, this is done automatically by the initial protocol exchanges between the client and server. In some cases, the calibration procedure may fail due to network or server access controls, for example. This command specifies the default delay to be used under these circumstances. Typically (for Ethernet), a number between 0.003 and 0.007 seconds is appropriate.</dd>
+  <dt id="broadcastdelay"><tt>broadcastdelay <i>delay</i></tt></dt>
+  <dd>In broadcast and multicast modes, means are required   to determine the network delay between the server and client. Ordinarily, this is done automatically by the initial calibration exchanges between the client and server. In some cases, the  exchange might not be possible due to network or server access controls. The value of <tt>delay</tt> is by default zero, in which case the  exchange is enabled. If <tt>delay</tt> is greater than zero, it becomes the roundtrip delay (s), as measured by the Unix <tt>ping</tt> program, and the exchange is disabled. </dd>
+  <dt>This command specifies the  delay to be used under these circumstances. Typically (for Ethernet), a number between 0.003 and 0.007 seconds is appropriate.</dt>
   <dt id="driftfile"><tt>driftfile <i>driftfile</i> { <i>tolerance</i> ]</tt></dt>
   <dd>This command specifies the complete path and name of the file used to record the frequency of the local clock oscillator. This is the same operation as the <tt>-f</tt> command line option. If the file exists, it is read at startup in order to set the initial frequency and then updated once per hour or more with the current frequency computed by the daemon. If the file name is specified, but the file itself does not exist, the starts with an initial frequency of zero and creates the file when writing it for the first time. If this command is not given, the daemon will always start with an initial frequency of zero.</dd>
   <dd>The file format consists of a single line containing a single floating point number, which records the frequency offset measured in parts-per-million (PPM). The file is updated by first writing the current drift value into a temporary file and then renaming this file to replace the old version. This implies that <tt>ntpd</tt> must have write permission for the directory the drift file is located in, and that file system links, symbolic or otherwise, should be avoided.</dd>
index d37b56057732fa3e931856bbcb7ec78495cad363..85dece6f76273c9e3a91d1a4958b5ce19d07ea64 100644 (file)
@@ -352,7 +352,7 @@ struct peer {
        double  jitter;         /* peer jitter (squares) */
        double  disp;           /* peer dispersion */
        double  xleave;         /* interleave delay */
-       double  bias;           /* bias for NIC asymmetry */
+       double  bias;           /* programmed offset bias */
 
        /*
         * Variables used to correct for packet length and asymmetry.
index 493f1f12bf2dd260c56421c20f60b5a65a1d8741..c52fd8e3693f46b02b47bdd8dc0351c794089eeb 100644 (file)
@@ -929,7 +929,6 @@ receive(
 
                        } else {
                                peer->delay = sys_bdelay;
-                               peer->bias = -sys_bdelay / 2.;
                        }
                        break;
                }
@@ -1570,7 +1569,6 @@ process_packet(
                p_del = fabs(t21 - t34);
                p_offset = (t21 + t34) / 2.;
        }
-       p_offset += peer->bias;
        p_disp = LOGTOD(sys_precision) + LOGTOD(peer->precision) +
            clock_phi * p_del;
 
@@ -1647,7 +1645,7 @@ process_packet(
        /*
         * That was awesome. Now hand off to the clock filter.
         */
-       clock_filter(peer, p_offset, p_del, p_disp);
+       clock_filter(peer, p_offset + peer->bias, p_del, p_disp);
 
        /*
         * If we are in broadcast calibrate mode, return to broadcast
@@ -2191,7 +2189,6 @@ clock_filter(
                clock_select();
                return;
        }
-
        etemp = fabs(peer->offset - peer->filter_offset[k]);
        peer->offset = peer->filter_offset[k];
        peer->delay = peer->filter_delay[k];
@@ -2309,7 +2306,7 @@ clock_select(void)
         * Allocate dynamic space depending on the number of
         * associations.
         */
-       nlist = 0;
+       nlist = 1;
        for (peer = peer_list; peer != NULL; peer = peer->p_link)
                nlist++;
        endpoint_size = nlist * 2 * sizeof(struct endpoint);