diff options
author | Kay Sievers <kay@vrfy.org> | 2014-03-31 04:00:04 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2014-03-31 04:09:39 +0200 |
commit | 42742bf1ce3a2a4fecb82df9d8adea57133ae33b (patch) | |
tree | c442ff9034a6b803107cdd0a528b4d14b4e1069e /src/timedate/timedate-sntp.c | |
parent | 2ad7561f9f658f8dee168a76654c7d918e2260c7 (diff) |
timedated: adjust accuracy and slew values
Diffstat (limited to 'src/timedate/timedate-sntp.c')
-rw-r--r-- | src/timedate/timedate-sntp.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/timedate/timedate-sntp.c b/src/timedate/timedate-sntp.c index e47a086567..b5d60c60af 100644 --- a/src/timedate/timedate-sntp.c +++ b/src/timedate/timedate-sntp.c @@ -59,24 +59,24 @@ #define ADJ_SETOFFSET 0x0100 /* add 'time' to current time */ #endif -/* Maximum delta in seconds which the system clock is gradually adjusted - * to approach the network time. Deltas larger that this are set by letting - * the system time jump. The maximum for adjtime is 500ms. - */ -#define NTP_MAX_ADJUST 0.2 +/* expected accuracy of time synchronization; used to adjust the poll interval */ +#define NTP_ACCURACY_SEC 0.2 /* - * "Define the required accuracy of the system clock, then calculate the - * maximum timeout. Use the longest maximum timeout possible given the system - * constraints to minimize time server aggregate load." - * * "A client MUST NOT under any conditions use a poll interval less * than 15 seconds." */ -#define NTP_POLL_INTERVAL_MIN_SEC 16 +#define NTP_POLL_INTERVAL_MIN_SEC 32 #define NTP_POLL_INTERVAL_MAX_SEC 2048 -#define NTP_ACCURACY_SEC 0.1 +/* + * Maximum delta in seconds which the system clock is gradually adjusted + * (slew) to approach the network time. Deltas larger that this are set by + * letting the system time jump. The kernel's limit for adjtime is 0.5s. + */ +#define NTP_MAX_ADJUST 0.4 + +/* NTP protocol, packet header */ #define NTP_LEAP_PLUSSEC 1 #define NTP_LEAP_MINUSSEC 2 #define NTP_LEAP_NOTINSYNC 3 @@ -666,7 +666,7 @@ int sntp_server_connect(SNTPContext *sntp, const char *server) { sntp->server_addr.sin_family = AF_INET; sntp->server_addr.sin_addr.s_addr = inet_addr(server); - sntp->poll_interval_usec = 2 * NTP_POLL_INTERVAL_MIN_SEC * USEC_PER_SEC; + sntp->poll_interval_usec = NTP_POLL_INTERVAL_MIN_SEC * USEC_PER_SEC; return sntp_send_request(sntp); } |