reference: activate local reference with large root distance

Since the update to NTPv4, when the clock is in the synchronised state
and the clock updates stop (e.g. sources become unreachable), it doesn't
switch to the unsynchronised state and the local reference is never
activate. This can be a problem for clients that rely on the server to
always have root distance below some value (e.g. chronyd's maxdistance).

Add a timer that will activate the local reference when the root
distance reaches a specified threshold. It can be configured with the
distance option in the local directive (by default 1.0 second).
This commit is contained in:
Miroslav Lichvar
2016-03-30 17:12:12 +02:00
parent 981f897c96
commit 81f440a882
5 changed files with 55 additions and 6 deletions

View File

@@ -60,7 +60,7 @@ typedef struct {
extern CPS_Status CPS_ParseNTPSourceAdd(char *line, CPS_NTP_Source *src);
/* Parse a command to enable local reference */
extern int CPS_ParseLocal(char *line, int *stratum);
extern int CPS_ParseLocal(char *line, int *stratum, double *distance);
/* Get a string describing error status */
extern void CPS_StatusToString(CPS_Status status, char *dest, int len);