This reverts commit
665c6a9eab46b0b253af6566ca9fc70c866b3fcd.
On Tue, Sep 2, 2014 at 3:17 PM, Miroslav Lichvar <mlichvar@redhat.com> wrote:
>
> With the other patch allowing missed replies included it's now getting
> stuck as there is no timer to send the 2nd and 3rd request.
return manager_connect(m);
}
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(
m->missed_replies++;
if (m->missed_replies > NTP_MAX_MISSED_REPLIES) {
r = sd_event_add_time(
/* valid packet */
m->pending = false;
/* valid packet */
m->pending = false;
/* announce leap seconds */
if (NTP_FIELD_LEAP(ntpmsg.field) & NTP_LEAP_PLUSSEC)
/* announce leap seconds */
if (NTP_FIELD_LEAP(ntpmsg.field) & NTP_LEAP_PLUSSEC)
/* last sent packet */
struct timespec trans_time_mon;
struct timespec trans_time;
/* last sent packet */
struct timespec trans_time_mon;
struct timespec trans_time;
bool pending;
/* poll timer */
bool pending;
/* poll timer */