return manager_connect(m);
}
+ /* re-arm timer with increasing timeout, in case the packets never arrive back */
+ if (m->retry_interval > 0) {
+ if (m->retry_interval < NTP_POLL_INTERVAL_MAX_SEC * USEC_PER_SEC)
+ m->retry_interval *= 2;
+ } else
+ m->retry_interval = NTP_POLL_INTERVAL_MIN_SEC * USEC_PER_SEC;
+
+ r = manager_arm_timer(m, m->retry_interval);
+ if (r < 0) {
+ log_error("Failed to rearm timer: %s", strerror(-r));
+ return r;
+ }
+
m->missed_replies++;
if (m->missed_replies > NTP_MAX_MISSED_REPLIES) {
r = sd_event_add_time(
/* valid packet */
m->pending = false;
+ m->retry_interval = 0;
/* announce leap seconds */
if (NTP_FIELD_LEAP(ntpmsg.field) & NTP_LEAP_PLUSSEC)