Replied: Tue, 17 Mar 1998 16:26:33 -0500
Replied: "Bruce Bartram 303-497-6217 <bwb@etl.noaa.gov> "
Received: from mail.eecis.udel.edu by whimsy.udel.edu id aa22608;
          17 Mar 1998 15:10 EST
Received: from mickey by netsrv (SMI-8.6/SMI-SVR4)
	id NAA10605; Tue, 17 Mar 1998 13:10:05 -0700
Received: by mickey (SMI-8.6/SMI-SVR4)
	id NAA02676; Tue, 17 Mar 1998 13:10:48 -0700
Date: Tue, 17 Mar 1998 13:10:48 -0700
From: Bruce Bartram 303-497-6217 <bwb@etl.noaa.gov>
Message-Id: <199803172010.NAA02676@mickey>
To: mills@udel.edu, stenn@whimsy.udel.edu
Subject: xntp 3-5.92c patch trouble

Howdy,

Attached is a trouble report from the newsgroup about a proposed patch
I sumbitted for xntp3-5.9x.  It seems that a pair of braces is needed
to make the code match the indentation's intent.

Bruce Bartram     bbartram@etl.noaa.gov    just another chimehead

-----
From: Klaus Kusche <Klaus.Kusche@ooe.gv.at>
Newsgroups: comp.protocols.time.ntp
Subject: Fatal bug in xntpd 3-5.92c!?!
Date: Tue, 17 Mar 1998 16:00:52 +0100
Organization: Government of Upper Austria, Computing Centre

When looking into my xntpd problems under AIX,
I found a piece of code (which was changed between
3-5.92 and 3-5.92c!) which looks wrong to me in 3-5.92c:
Braces are missing around the body of an "if".

If I understand things correctly, this bug
causes xntpd not to adjust the local clock any more
as soon as it has sync'ed to any peer!!!

Below is the diff between the original 3-5.92c file
and the file with the braces I inserted.

*** ntp_loopfilter.c.sav        Tue Mar 17 14:57:00 1998
--- ntp_loopfilter.c    Tue Mar 17 14:58:02 1998
***************
*** 586,592 ****
         */
        if (sys_peer) {
                if (sys_peer->refclktype == REFCLK_LOCALCLOCK &&
!                   sys_peer->flags & FLAG_PREFER)
                         /* I think that sys_clock_offset might be
jammed
                          * to exactly zero now.  It might have had a
                          * small residual before things switched to the
--- 586,592 ----
         */
        if (sys_peer) {
                if (sys_peer->refclktype == REFCLK_LOCALCLOCK &&
!                   sys_peer->flags & FLAG_PREFER) {
                         /* I think that sys_clock_offset might be
jammed
                          * to exactly zero now.  It might have had a
                          * small residual before things switched to the
***************
*** 595,600 ****
--- 595,601 ----
                          * when the external control jumped the time */
                        L_CLR(&sys_clock_offset);
                        return;
+               }
        }
        L_CLR(&offset);
        L_ADDF(&offset, adjustment);

-- 
DI. Dr. Klaus Kusche
Oberoesterreichische Landesregierung / Government of Upper Austria
Rechenzentrum / Computing Centre
Smail: Kaerntnerstrasse 16, A-4020 Linz, Austria (Europe)
Phone: +43 732 7720 - 3394   Fax: +43 732 7720 - 3198
Email: Klaus.Kusche@ooe.gv.at

