mirror of
https://github.com/systemd/systemd.git
synced 2025-02-04 21:47:31 +03:00
timesync: rename variable to match config name
PollIntervalMinSec and PollIntervalMaxSec use the same pattern, but RootDistanceMaxSec had switched orderd in the code.
This commit is contained in:
parent
c91ebcdbd1
commit
403db47069
@ -165,7 +165,7 @@ static const sd_bus_vtable manager_vtable[] = {
|
||||
SD_BUS_PROPERTY("FallbackNTPServers", "as", property_get_servers, offsetof(Manager, fallback_servers), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("ServerName", "s", property_get_current_server_name, offsetof(Manager, current_server_name), 0),
|
||||
SD_BUS_PROPERTY("ServerAddress", "(iay)", property_get_current_server_address, offsetof(Manager, current_server_address), 0),
|
||||
SD_BUS_PROPERTY("RootDistanceMaxUSec", "t", bus_property_get_usec, offsetof(Manager, max_root_distance_usec), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("RootDistanceMaxUSec", "t", bus_property_get_usec, offsetof(Manager, root_distance_max_usec), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("PollIntervalMinUSec", "t", bus_property_get_usec, offsetof(Manager, poll_interval_min_usec), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("PollIntervalMaxUSec", "t", bus_property_get_usec, offsetof(Manager, poll_interval_max_usec), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("PollIntervalUSec", "t", bus_property_get_usec, offsetof(Manager, poll_interval_usec), 0),
|
||||
|
@ -21,7 +21,7 @@ struct ConfigPerfItem;
|
||||
Time.NTP, config_parse_servers, SERVER_SYSTEM, 0
|
||||
Time.Servers, config_parse_servers, SERVER_SYSTEM, 0
|
||||
Time.FallbackNTP, config_parse_servers, SERVER_FALLBACK, 0
|
||||
Time.RootDistanceMaxSec, config_parse_sec, 0, offsetof(Manager, max_root_distance_usec)
|
||||
Time.RootDistanceMaxSec, config_parse_sec, 0, offsetof(Manager, root_distance_max_usec)
|
||||
Time.PollIntervalMinSec, config_parse_sec, 0, offsetof(Manager, poll_interval_min_usec)
|
||||
Time.PollIntervalMaxSec, config_parse_sec, 0, offsetof(Manager, poll_interval_max_usec)
|
||||
Time.ConnectionRetrySec, config_parse_sec, 0, offsetof(Manager, connection_retry_usec)
|
||||
|
@ -34,7 +34,7 @@
|
||||
#define ADJ_SETOFFSET 0x0100 /* add 'time' to current time */
|
||||
#endif
|
||||
|
||||
/* expected accuracy of time synchronization; used to adjust the poll interval */
|
||||
/* Expected accuracy of time synchronization; used to adjust the poll interval */
|
||||
#define NTP_ACCURACY_SEC 0.2
|
||||
|
||||
/*
|
||||
@ -45,7 +45,7 @@
|
||||
#define NTP_MAX_ADJUST 0.4
|
||||
|
||||
/* Default of maximum acceptable root distance in microseconds. */
|
||||
#define NTP_MAX_ROOT_DISTANCE (5 * USEC_PER_SEC)
|
||||
#define NTP_ROOT_DISTANCE_MAX_USEC (5 * USEC_PER_SEC)
|
||||
|
||||
/* Maximum number of missed replies before selecting another source. */
|
||||
#define NTP_MAX_MISSED_REPLIES 2
|
||||
@ -507,7 +507,7 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
|
||||
}
|
||||
|
||||
root_distance = ntp_ts_short_to_d(&ntpmsg.root_delay) / 2 + ntp_ts_short_to_d(&ntpmsg.root_dispersion);
|
||||
if (root_distance > (double) m->max_root_distance_usec / (double) USEC_PER_SEC) {
|
||||
if (root_distance > (double) m->root_distance_max_usec / (double) USEC_PER_SEC) {
|
||||
log_info("Server has too large root distance. Disconnecting.");
|
||||
return manager_connect(m);
|
||||
}
|
||||
@ -1081,7 +1081,7 @@ int manager_new(Manager **ret) {
|
||||
if (!m)
|
||||
return -ENOMEM;
|
||||
|
||||
m->max_root_distance_usec = NTP_MAX_ROOT_DISTANCE;
|
||||
m->root_distance_max_usec = NTP_ROOT_DISTANCE_MAX_USEC;
|
||||
m->poll_interval_min_usec = NTP_POLL_INTERVAL_MIN_USEC;
|
||||
m->poll_interval_max_usec = NTP_POLL_INTERVAL_MAX_USEC;
|
||||
|
||||
|
@ -79,7 +79,7 @@ struct Manager {
|
||||
} samples[8];
|
||||
unsigned samples_idx;
|
||||
double samples_jitter;
|
||||
usec_t max_root_distance_usec;
|
||||
usec_t root_distance_max_usec;
|
||||
|
||||
/* last change */
|
||||
bool jumped;
|
||||
|
Loading…
x
Reference in New Issue
Block a user