From c06f3adc840ab257cc264074646fad3a2f6a3d9b Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sat, 1 Sep 2012 12:28:15 +0200 Subject: [PATCH] Differentiate between the E2E and P2P delay timeout intervals. We have one timer used for both delay request mechanisms, and we ought to set the message interval accordingly. Signed-off-by: Richard Cochran --- port.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/port.c b/port.c index 27e5ea8..e206897 100644 --- a/port.c +++ b/port.c @@ -379,7 +379,12 @@ static int port_set_delay_tmo(struct port *p) struct itimerspec tmo = { {0, 0}, {0, 0} }; - int index = random() % TMTAB_MAX; + int index; + if (p->delayMechanism == DM_P2P) { + return set_tmo(p->fda.fd[FD_DELAY_TIMER], 1, + p->logMinPdelayReqInterval); + } + index = random() % TMTAB_MAX; tmo.it_value = p->tmtab.ts[index]; return timerfd_settime(p->fda.fd[FD_DELAY_TIMER], 0, &tmo, NULL); }