summaryrefslogtreecommitdiff
path: root/src/timesync
diff options
context:
space:
mode:
authorMiroslav Lichvar <mlichvar@redhat.com>2014-08-27 16:47:17 +0200
committerKay Sievers <kay@vrfy.org>2014-08-29 18:13:00 +0200
commit07610e108e2d3f046da683a3a69c4d5cccd2cf8e (patch)
tree46c63322236ccd907776a29b530e1bccf543480c /src/timesync
parent6ff8806e1d20a4d3cbc4b360326ea3786768f0ca (diff)
timesyncd: check if stratum is valid
Diffstat (limited to 'src/timesync')
-rw-r--r--src/timesync/timesyncd-manager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index d80c72ff5c..60f39c638d 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -574,7 +574,8 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
return manager_connect(m);
}
- if (NTP_FIELD_LEAP(ntpmsg.field) == NTP_LEAP_NOTINSYNC) {
+ if (NTP_FIELD_LEAP(ntpmsg.field) == NTP_LEAP_NOTINSYNC ||
+ ntpmsg.stratum == 0 || ntpmsg.stratum >= 16) {
log_debug("Server is not synchronized. Disconnecting.");
return manager_connect(m);
}