From: Miroslav Lichvar Date: Tue, 27 Oct 2009 13:04:59 +0000 (+0100) Subject: Make default refclock refid from number of the source X-Git-Tag: 1.24-pre1~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cd9e68246bfeb880eea0582a5b31257bd4d43fe;p=thirdparty%2Fchrony.git Make default refclock refid from number of the source It should avoid having two or more refclocks with the same refid. --- diff --git a/refclock.c b/refclock.c index a633870b..f5bb81c2 100644 --- a/refclock.c +++ b/refclock.c @@ -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]; }