There can be multiple instances of the same refclock with different unit
numbers. The unit number needs to be a part of the peer name, otherwise
the code will try to write the measurements from multiple peers to the
same RRD file.
if (refclock_id < refclock_names_num)
{
- sstrncpy (peername, refclock_names[refclock_id],
- sizeof (peername));
+ /* The unit number is in the lowest byte. */
+ ssnprintf (peername, sizeof (peername),
+ "%s%i",
+ refclock_names[refclock_id],
+ ntohl (ptr->srcadr) & 0xFF);
}
else
{