Commit 2f4b3392 authored by Beniamino Galvani's avatar Beniamino Galvani

n-acd: use RFC 5227 timeout for announcements

When doing announcements, use the the timeout specified by RFC
5227. Note that timeout_multiplier might be 0.

This aligns behavior to upstream version of n-acd.
parent d97eab6c
......@@ -563,7 +563,14 @@ static int n_acd_handle_timeout(NAcd *acd) {
return r;
if (++acd->n_iteration < N_ACD_RFC_ANNOUNCE_NUM) {
r = n_acd_schedule(acd, acd->timeout_multiplier * N_ACD_RFC_ANNOUNCE_INTERVAL_USEC, 0);
/*
* Announcements are always scheduled according to the
* time-intervals specified in the spec. We always use
* the RFC5227-mandated multiplier.
* If you reconsider this, note that timeout_multiplier
* might be 0 here.
*/
r = n_acd_schedule(acd, N_ACD_TIMEOUT_RFC5227 * N_ACD_RFC_ANNOUNCE_INTERVAL_USEC, 0);
if (r < 0)
return r;
}
......
......@@ -15,6 +15,8 @@ extern "C" {
#include <netinet/in.h>
#include <stdbool.h>
#define N_ACD_TIMEOUT_RFC5227 (UINT64_C(9000))
enum {
_N_ACD_E_SUCCESS,
......
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