]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3484] ntpq response from ntpd is incorrect when REFID is null
authorJuergen Perlinger <perlinger@ntp.org>
Wed, 11 Apr 2018 17:26:04 +0000 (19:26 +0200)
committerJuergen Perlinger <perlinger@ntp.org>
Wed, 11 Apr 2018 17:26:04 +0000 (19:26 +0200)
bk: 5ace452cxIn7bxVukTL2U2qMEZEFIA

ChangeLog
ntpd/ntp_control.c

index 45a670849009b8df36bca29012044da83256e690..6558787a9a353eb1eb61cc7cd179fb5683ff2566 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
 * [Bug 3485] Undefined sockaddr used in error messages in ntp_config.c <perlinger@ntp.org>
   - applied patch by Gerry Garvey
+* [Bug 3484] ntpq response from ntpd is incorrect when REFID is null <perlinger@ntp.org>
 * [Bug 3482] Fixes for compilation warnings (ntp_io.c & ntpq-subs.c) <perlinger@ntp.org>
   - applied patch by Gerry Garvey (with mods)
 * [Bug 3480] Refclock sample filter not cleared on clock STEP <perlinger@ntp.org>
index 797e850c2e141542cdfe9ad22a3f77aa8233814f..8f311334cc2b31ec9862e7074c2729b52123c06c 100644 (file)
@@ -1633,14 +1633,14 @@ ctl_putunqstr(
        
        args[0].buf = tag;
        args[0].len = strlen(tag);
+       args[1].buf = "=";
+       args[1].len = 1;
        if (data && len) {
-           args[1].buf = "=";
-           args[1].len = 1;
-           args[2].buf = data;
-           args[2].len = len;
-           ctl_putdata_ex(args, 3, FALSE);
+               args[2].buf = data;
+               args[2].len = len;
+               ctl_putdata_ex(args, 3, FALSE);
        } else {
-           ctl_putdata_ex(args, 1, FALSE);
+               ctl_putdata_ex(args, 2, FALSE);
        }
 }