chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
timesyncd: check if stratum is valid
[elogind.git]
/
src
/
timesync
/
timesyncd-manager.c
diff --git
a/src/timesync/timesyncd-manager.c
b/src/timesync/timesyncd-manager.c
index d80c72ff5c1f077c85a0659f53c1260992ef848d..60f39c638d3bdd715cf6ca0cb7a720a392b19803 100644
(file)
--- 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);
}
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);
}
log_debug("Server is not synchronized. Disconnecting.");
return manager_connect(m);
}