Commit dc343a13 authored by Alessandro Rubini's avatar Alessandro Rubini

bugfix: master: restart timeouts when they expire

It look like the timeouts were not restarted after they expired (and
the respecti message is sent).  The previous commit, that disables
expired timers automatically, exposed this bug.  Unless I misunderstood,
the 1s timing of announce message was due to the 1s-long delay
between re-invocations of the state-master code.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 655bd587
......@@ -41,11 +41,19 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
&OPTS(ppi)->outbound_latency);
if (msg_issue_followup(ppi, time_snt))
goto out;
/* Restart the timeout for next time */
pp_timeout_set(ppi, PP_TO_SYNC,
(1 << DSPOR(ppi)->logSyncInterval) * 1000);
}
if (pp_timeout_z(ppi, PP_TO_ANN_INTERVAL)) {
if (msg_issue_announce(ppi) < 0)
goto out;
/* Restart the timeout for next time */
pp_timeout_set(ppi, PP_TO_ANN_INTERVAL,
(1 << DSPOR(ppi)->logAnnounceInterval) * 1000);
}
if (plen == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment