]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
refclock: start refid numbering at zero
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 17 Feb 2015 09:26:06 +0000 (10:26 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 17 Feb 2015 09:33:03 +0000 (10:33 +0100)
Commit d92583ed inadvertently changed the refclock refid numbering to
start from 1 instead of 0. Restore the original numbering.

refclock.c

index 5b728eb41a5115f72567749fd040a162c831f389..59e9297244cdbb72556bec66f1a9b82b2e6d47d0 100644 (file)
@@ -226,7 +226,7 @@ RCL_AddRefclock(RefclockParameters *params)
     inst->ref_id = params->ref_id;
   else {
     unsigned char ref[5] = { 0, 0, 0, 0, 0 };
-    unsigned int index = ARR_GetSize(refclocks);
+    unsigned int index = ARR_GetSize(refclocks) - 1;
 
     snprintf((char *)ref, sizeof (ref), "%3.3s", params->driver_name);
     ref[3] = index % 10 + '0';