Bug 12001 - [ntpd] - not able to query
Summary: [ntpd] - not able to query
Status: RESOLVED INVALID
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.30.x
Hardware: Other Other
: P2 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-01 21:52 UTC by lkjdf
Modified: 2019-07-03 10:29 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lkjdf 2019-07-01 21:52:59 UTC
* OpenWRT 19.07 with kernel 4.14.131 armv7l
* busybox 1.30.1
-----

# /sbin/ntpd -nNlSddddp 1.openwrt.pool.ntp.org

# ss -tulpn | grep 123
udp   UNCONN 0  0  *:123 *:*  users:(("ntpd",pid=15989,fd=3))

-----

# ntpq -p
localhost: timed out, nothing received
***Request timed out

ntpd: malformed packet received from ::1: size 12
ntpd: malformed packet received from ::1: size 12

-----

# ntpdate localhost
no server suitable for synchronization found

no output from ntpd

-----

# ntpdc -lnps
localhost: timed out, nothing received
***Request timed out
localhost: timed out, nothing received
***Request timed out
localhost: timed out, nothing received
***Request timed out

no output from ntpd

-----

# ntptime -r
ntp_gettime() returns code 5 (ERROR)
ntp_adjtime() returns code 5 (ERROR)


no output from ntpd
Comment 1 lkjdf 2019-07-03 09:49:30 UTC
http://lists.busybox.net/pipermail/busybox/2019-July/087369.html

ntpq sends a packet with m_status of 0x16,
which is NTPv2, "reserved1" mode (6).

Probably described here:
https://docs.ntpsec.org/latest/mode6.html

and in this case, it is probably used to get peer list.

busybox does not understand these extensions.
-----

whilst his explains the failing queries with ntpq -p it does not however for:

# ntpdate localhost
no server suitable for synchronization found

# ntpdc -lnps
localhost: timed out, nothing received
***Request timed out
localhost: timed out, nothing received
***Request timed out
localhost: timed out, nothing received
***Request timed out

# ntptime -r
ntp_gettime() returns code 5 (ERROR)
ntp_adjtime() returns code 5 (ERROR)
Comment 2 lkjdf 2019-07-03 10:29:21 UTC
ntpq | ntpdc queries relying on NTPv2 mode (6) which is not supported by busybox.

ntptime is not a tool for querying ntpd, instead it reads and sets kernel time variables

whilst ntpdate localhost strangely fails it works with ntpdate -d localhost