Your message dated Wed, 11 Oct 2006 13:31:10 +0200
with message-id <[EMAIL PROTECTED]>
and subject line Bug#243518: patch to make ntpq show hostnames in "refid" field
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: ntp
Version: 1:4.2.0a-5
Severity: wishlist

ntpq only shows numeric IP addresses in the "refid" field of the "peers"
output. This small patch makes it show human-friendly hostnames,
but respects the "-n" option to show IP addresses if desired.

Example of output without this patch:

[EMAIL PROTECTED]:~$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
-MSF_ARCRON(0)   MSF_ARCRON(0)    5 l   61   64  376    0.000   57.197   7.335
+sptsrv1.interna 193.62.203.67    3 u  284  512  377    0.331   53.482   1.193
-ntp1.sanger.ac. 193.62.203.67    3 u  331  512  377    0.394   52.184   2.004
*ntp2.sanger.ac. 128.86.8.123     2 u    6  512  377    0.541   53.489   1.846

Example of output with this patch:

[EMAIL PROTECTED]:~/debian/ntp-4.2.0a/debian/ntp/usr/bin$ ./ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+MSF_ARCRON(0)   MSF_ARCRON(0)    5 l   26   64  377    0.000   53.714   3.466
+sptsrv1.interna ntp3.sanger.ac.  3 u  443  512  377    0.331   53.482   1.193
-ntp1.sanger.ac. ntp3.sanger.ac.  3 u  490  512  377    0.394   52.184   2.004
*ntp2.sanger.ac. ntp0.ja.net      2 u  165  512  377    0.541   53.489   1.846

Patch:

diff -ur ntp-4.2.0a.orig/ntpq/ntpq_ops.c ntp-4.2.0a/ntpq/ntpq_ops.c
--- ntp-4.2.0a.orig/ntpq/ntpq_ops.c     2003-10-22 16:12:55.000000000 +0100
+++ ntp-4.2.0a/ntpq/ntpq_ops.c  2004-04-13 14:57:21.000000000 +0100
@@ -1426,7 +1426,7 @@
                                                    refnumtoa(&dstadr);
                                        else
                                                dstadr_refid =
-                                                   stoa(&dstadr);
+                                                   nntohost(&dstadr);
                                } else if ((int)strlen(value) <= 4) {
                                        refid_string[0] = '.';
                                        (void) strcpy(&refid_string[1], value);



--- End Message ---
--- Begin Message ---
The NTP specification says that a refid is a "32-bit code", which is what the 
IP address represents.  So resolving this to a host name would be 
semantically wrong.

--- End Message ---

Reply via email to