]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
B[ug 3449] ntpq - display "loop" instead of refid for peers which are flagged as...
authorJuergen Perlinger <perlinger@ntp.org>
Fri, 13 Apr 2018 20:38:02 +0000 (22:38 +0200)
committerJuergen Perlinger <perlinger@ntp.org>
Fri, 13 Apr 2018 20:38:02 +0000 (22:38 +0200)
bk: 5ad1152aTVIHj8hivD8NqZMBQFloZQ

ChangeLog
ntpq/ntpq-subs.c

index 6558787a9a353eb1eb61cc7cd179fb5683ff2566..24b371b6ace2c630677e885eafa82543e579500c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,8 @@
   - initial patch by Hal Murray; also fixed refclock_report() trouble
 * [Bug 3456] Use uintptr_t rather than size_t to store an integer in a pointer
   - According to Brooks Davis, there was only one location <perlinger@ntp.org>
+* [Bug 3449] ntpq - display "loop" instead of refid [...] <perlinger@ntp.org>
+  - applied patch by Gerry Garvey
 * [Bug 2821] minor build issues <perlinger@ntp.org>
   - applied patches by Christos Zoulas, including real bug fixes
 
index e202c6ab3e377f8a7a0153abc1c61948fd5644b1..11a9266f72024c7b8abaec734c895f3d4ed8903c 100644 (file)
@@ -1643,6 +1643,7 @@ doprintpeers(
        l_fp rec;
        l_fp ts;
        u_long poll_sec;
+       u_long flash = 0;
        char type = '?';
        char clock_name[LENHOSTNAME];
        char whenbuf[12], pollbuf[12];
@@ -1779,6 +1780,8 @@ doprintpeers(
                } else if (!strcmp("reftime", name)) {
                        if (!decodets(value, &reftime))
                                L_CLR(&reftime);
+               } else if (!strcmp("flash", name)) {
+                   decodeuint(value, &flash);
                } else {
                        // fprintf(stderr, "UNRECOGNIZED name=%s ", name);
                }
@@ -1858,7 +1861,9 @@ doprintpeers(
                                                        + 1 + 15 + 1, "");
                else
                        fprintf(fp, "%c%-15.15s ", c, clock_name);
-               if (!have_da_rid) {
+               if ((flash & TEST12) && (pvl != opeervarlist)) {
+                       drlen = fprintf(fp, "(loop)");
+               } else if (!have_da_rid) {
                        drlen = 0;
                } else {
                        drlen = strlen(dstadr_refid);