]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: take auto_offline sources offline before sending new request
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 23 Oct 2014 11:11:59 +0000 (13:11 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 23 Oct 2014 13:06:00 +0000 (15:06 +0200)
ntp_core.c

index cdc32dfc6e80f3751b970126d5c0584065d27c2c..833ade6f1cccda920670b1c4ef675b20ea1c5bbb 100644 (file)
@@ -847,6 +847,10 @@ transmit_timeout(void *arg)
       break;
   }
 
+  /* With auto_offline take the source offline on 2nd missed reply */
+  if (inst->auto_offline && inst->tx_count >= 2)
+    NCR_TakeSourceOffline(inst);
+
   if (inst->opmode == MD_OFFLINE) {
     return;
   }
@@ -908,10 +912,6 @@ transmit_timeout(void *arg)
     }
 
     SRC_UpdateReachability(inst->source, 0);
-
-    if (inst->auto_offline && inst->tx_count >= 3) {
-      NCR_TakeSourceOffline(inst);
-    }
   }
 
   switch (inst->opmode) {