Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!wuarchive!uunet!dg-rtp!bigben!bigben!bigben!philip From: philip@beeblebrox.dle.dg.com (Philip Gladstone) Newsgroups: comp.protocols.time.ntp Subject: Bug in xntp version 1.3 in clock selection Message-ID: Date: 6 Jun 91 15:35:13 GMT Sender: usenet@dle.dg.com (Net News) Distribution: comp Organization: Data General, Development Lab Europe Lines: 87 I found a nasty bug this morning in the clock selection code in xntp 1.3. It turns out that the casting out of outlying clocks is just done wrong. This results in incorrect clock selections. I enclose the (trivial) patch. Apply in the xntpd directory with 'patch < filename' Good luck. Philip ---cut here *** orig_ntp_proto.c Thu Jun 6 12:14:15 1991 --- ntp_proto.c Thu Jun 6 12:49:06 1991 *************** *** 1561,1566 **** --- 1561,1568 ---- */ for (i = 0; i < j; i++) d = (d>>1) + (d>>2); + + peer_badness[n] += d; } break; *************** *** 1600,1605 **** --- 1602,1609 ---- else d = (d>>1) + (d>>2); } + + peer_badness[n] += d; } break; *************** *** 1638,1643 **** --- 1642,1649 ---- else d = (d>>1) + (d>>2); } + + peer_badness[n] += d; } break; *************** *** 1659,1664 **** --- 1665,1672 ---- */ for (i = 0; i < j; i++) d = (d>>1) + (d>>3) + (d>>4); + + peer_badness[n] += d; } break; *************** *** 1680,1685 **** --- 1688,1695 ---- */ for (i = 0; i < j; i++) d = (d>>1) + (d>>3); + + peer_badness[n] += d; } break; *************** *** 1692,1698 **** sys_select_algorithm); exit(1); } - peer_badness[n] += d; } /* --- 1702,1707 ---- --- end of patch -- Philip Gladstone Dev Lab Europe, Data General, Cambridge, UK I seem to be having this tremendous difficulty with my lifestyle. ***WARNING: This article may be a duplicate....