From 979b53866d3a4fd82de68d6a052ebb6a7e90e187 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 5 Dec 2016 10:44:04 +0100 Subject: [PATCH] client: print addresses with refids in ntpdata report --- client.c | 9 +++++---- doc/chronyc.adoc | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/client.c b/client.c index d0e9094..7f1a5ff 100644 --- a/client.c +++ b/client.c @@ -2215,9 +2215,9 @@ process_cmd_ntpdata(char *line) UTI_IPNetworkToHost(&reply.data.ntp_data.local_addr, &local_addr); UTI_TimespecNetworkToHost(&reply.data.ntp_data.ref_time, &ref_time); - print_report("Remote address : %s\n" + print_report("Remote address : %s (%R)\n" "Remote port : %u\n" - "Local address : %s\n" + "Local address : %s (%R)\n" "Leap status : %L\n" "Version : %u\n" "Mode : %M\n" @@ -2241,8 +2241,9 @@ process_cmd_ntpdata(char *line) "Total TX : %U\n" "Total RX : %U\n" "Total valid RX : %U\n", - UTI_IPToString(&remote_addr), ntohs(reply.data.ntp_data.remote_port), - UTI_IPToString(&local_addr), + UTI_IPToString(&remote_addr), (unsigned long)UTI_IPToRefid(&remote_addr), + ntohs(reply.data.ntp_data.remote_port), + UTI_IPToString(&local_addr), (unsigned long)UTI_IPToRefid(&local_addr), reply.data.ntp_data.leap, reply.data.ntp_data.version, reply.data.ntp_data.mode, reply.data.ntp_data.stratum, reply.data.ntp_data.poll, UTI_Log2ToDouble(reply.data.ntp_data.precision), diff --git a/doc/chronyc.adoc b/doc/chronyc.adoc index 2bbb679..eee086b 100644 --- a/doc/chronyc.adoc +++ b/doc/chronyc.adoc @@ -447,9 +447,9 @@ NTP-specific information about the NTP source. An example of the output is shown below. + ---- -Remote address : 203.0.113.15 +Remote address : 203.0.113.15 (CB00710F) Remote port : 123 -Local address : 203.0.113.74 +Local address : 203.0.113.74 (CB00714A) Leap status : Normal Version : 4 Mode : Server @@ -478,12 +478,13 @@ Total valid RX : 24 The fields are explained as follows: + *Remote address*::: -The IP address of the NTP server or peer. +The IP address of the NTP server or peer, and the corresponding reference ID. *Remote port*::: The UDP port number to which the request was sent. The standard NTP port is 123. *Local address*::: -The local IP address which received the response. +The local IP address which received the response, and the corresponding +reference ID. *Leap status*::: *Version*::: *Mode*:::