From: Juergen Perlinger Date: Fri, 13 Apr 2018 20:38:02 +0000 (+0200) Subject: B[ug 3449] ntpq - display "loop" instead of refid for peers which are flagged as... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae83b25868e698e38525603e135964367aaa778e;p=thirdparty%2Fntp.git B[ug 3449] ntpq - display "loop" instead of refid for peers which are flagged as loops bk: 5ad1152aTVIHj8hivD8NqZMBQFloZQ --- diff --git a/ChangeLog b/ChangeLog index 6558787a9..24b371b6a 100644 --- 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 +* [Bug 3449] ntpq - display "loop" instead of refid [...] + - applied patch by Gerry Garvey * [Bug 2821] minor build issues - applied patches by Christos Zoulas, including real bug fixes diff --git a/ntpq/ntpq-subs.c b/ntpq/ntpq-subs.c index e202c6ab3..11a9266f7 100644 --- a/ntpq/ntpq-subs.c +++ b/ntpq/ntpq-subs.c @@ -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);