From: Harlan Stenn Date: Fri, 22 Oct 2010 05:56:16 +0000 (-0400) Subject: [Bug 1670] Fix peer->bias and broadcastdelay X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6255a07b4409ade6f9eeba1a44625f4aa9cfdfc;p=thirdparty%2Fntp.git [Bug 1670] Fix peer->bias and broadcastdelay bk: 4cc12780fGDDck-mqpB0XRzrglDP3w --- diff --git a/ChangeLog b/ChangeLog index 557cd412bc..ba0f0e1efa 100644 --- 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 diff --git a/html/miscopt.html b/html/miscopt.html index 0865215948..2f44eeea84 100644 --- a/html/miscopt.html +++ b/html/miscopt.html @@ -10,7 +10,7 @@ giffrom Pogo, Walt Kelly

We have three, now looking for more.

Last update: - 21-Sep-2010 20:48 + 22-Oct-2010 5:31 UTC


Related Links

@@ -19,8 +19,9 @@

Commands and Options

-
broadcastdelay seconds
-
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.
+
broadcastdelay delay
+
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 delay is by default zero, in which case the exchange is enabled. If delay is greater than zero, it becomes the roundtrip delay (s), as measured by the Unix ping program, and the exchange is disabled.
+
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.
driftfile driftfile { tolerance ]
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 -f 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.
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 ntpd must have write permission for the directory the drift file is located in, and that file system links, symbolic or otherwise, should be avoided.
diff --git a/include/ntp.h b/include/ntp.h index d37b560577..85dece6f76 100644 --- a/include/ntp.h +++ b/include/ntp.h @@ -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. diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 493f1f12bf..c52fd8e369 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -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);