From: Michal Schmidt <mschmidt@redhat.com>
Date: Wed, 10 Sep 2014 19:00:56 +0200
Subject: timesyncd: check if stratum is valid

Upstream commit:
commit 07610e108e2d3f046da683a3a69c4d5cccd2cf8e
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date:   Wed Aug 27 16:47:17 2014 +0200

    timesyncd: check if stratum is valid
---
 src/timesync/timesyncd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c
index efe9544..dc00b2f 100644
--- a/src/timesync/timesyncd.c
+++ b/src/timesync/timesyncd.c
@@ -639,7 +639,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);
         }
