[Bug 5738] New: ntpd incorrectly responds as "NTP version 7"

bugzilla at busybox.net bugzilla at busybox.net
Fri Nov 23 03:46:42 UTC 2012


           Summary: ntpd incorrectly responds as "NTP version 7"
           Product: Busybox
           Version: 1.19.x
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: Networking
        AssignedTo: unassigned at busybox.net
        ReportedBy: paul at pmarks.net
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0

When I run the busybox ntpd server, it fails to work with chrony as a client. 
Chrony uses NTPv3, and it's failing because ntpd's response packets have the
following status byte:


Notice that the second part (the NTP version) is set to 7 instead of 3.  This
is actually the bitwise-OR of versions 4 and 3.

The following 1-line patch to ntpd.c fixes the problem for me:

- msg.m_status = G.stratum < MAXSTRAT ? G.ntp_status : LI_ALARM;
+ msg.m_status = G.stratum < MAXSTRAT ? (G.ntp_status & LI_MASK) : LI_ALARM;

This ensures that *only* the Leap Indicator bits are copied from G.ntp_status.

Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the busybox-cvs mailing list