]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Make default refclock refid from number of the source
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 27 Oct 2009 13:04:59 +0000 (14:04 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 27 Oct 2009 13:04:59 +0000 (14:04 +0100)
It should avoid having two or more refclocks with the same refid.

refclock.c

index a633870be7fa917f3a6493e67302d2af45a06873..f5bb81c2ed9a938d991c6f45879a87e643469230 100644 (file)
@@ -145,7 +145,7 @@ RCL_AddRefclock(RefclockParameters *params)
   else {
     unsigned char ref[5] = { 0, 0, 0, 0, 0 };
 
-    snprintf((char *)ref, 5, "%s%s", params->driver_name, params->driver_parameter);
+    snprintf((char *)ref, 5, "%3s%d", params->driver_name, n_sources % 10);
     inst->ref_id = ref[0] << 24 | ref[1] << 16 | ref[2] << 8 | ref[3];
   }