From: Juergen Perlinger Date: Sat, 14 Oct 2017 06:37:26 +0000 (+0200) Subject: [Bug 3435] anchor NTP era alignment X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0af4a0d48b9f6d6383a178a7adf5373eb2de98e8;p=thirdparty%2Fntp.git [Bug 3435] anchor NTP era alignment bk: 59e1b0a6M8b40QR_jp7-h4PgIv1sGQ --- diff --git a/html/miscopt.html b/html/miscopt.html index b458d799a..69dbc3e00 100644 --- a/html/miscopt.html +++ b/html/miscopt.html @@ -11,7 +11,7 @@ giffrom Pogo, Walt Kelly

We have three, now looking for more.

Last update: - 9-Nov-2016 12:26 + 14-Oct-2017 08:34 UTC


Related Links

diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 16fccb76e..853e12f91 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -312,7 +312,7 @@ static void config_monitor(config_tree *); static void config_rlimit(config_tree *); static void config_system_opts(config_tree *); static void config_tinker(config_tree *); -static void config_tos_clock(config_tree *); +static int config_tos_clock(config_tree *); static void config_tos(config_tree *); static void config_vars(config_tree *); @@ -2025,13 +2025,19 @@ free_config_auth( #endif /* FREE_CFG_T */ -static void +/* Configure low-level clock-related parameters. Return TRUE if the + * clock might need adjustment like era-checking after the call, FALSE + * otherwise. + */ +static int/*BOOL*/ config_tos_clock( config_tree *ptree ) { + int ret; attr_val * tos; + ret = FALSE; tos = HEAD_PFIFO(ptree->orphan_cmds); for (; tos != NULL; tos = tos->link) { switch(tos->attr) { @@ -2041,9 +2047,11 @@ config_tos_clock( case T_Basedate: basedate_set_day(tos->value.i); + ret = TRUE; break; } } + return ret; } static void @@ -4467,10 +4475,13 @@ config_ntpd( int/*BOOL*/ input_from_files ) { - dump_config_tree(ptree, stderr, 1); + /* [Bug 3435] check and esure clock sanity if configured from + * file and clock sanity parameters (-> basedate) are given. Do + * this ASAP, so we don't disturb the closed loop controller. + */ if (input_from_files) { - config_tos_clock(ptree); - clamp_systime(); + if (config_tos_clock(ptree)) + clamp_systime(); } config_nic_rules(ptree, input_from_files);