From 72c3b44800c5b25d5399b05e1bc6aece44414f49 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Fri, 25 Mar 2011 14:26:53 -0700 Subject: [PATCH] cfm: Reduce missed CCM detection time. The specification says that a fault should be signaled when 3.5 * ccm_interval milliseconds have passed. This commit respects that requirement, possibly increasing the responsiveness of fault detection slightly. --- lib/cfm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/cfm.c b/lib/cfm.c index d0f3ee05..ce1269ba 100644 --- a/lib/cfm.c +++ b/lib/cfm.c @@ -192,9 +192,8 @@ cfm_run(struct cfm *cfm) * MPs at once making this quite a bit simpler. * * According to the specification we should check when (ccm_interval_ms * - * 3.5)ms have passed. We changed the multiplier to 4 to avoid messy - * floating point arithmetic and add a bit of wiggle room. */ - if (now >= cfmi->fault_check + cfmi->ccm_interval_ms * 4) { + * 3.5)ms have passed. */ + if (now >= cfmi->fault_check + (cfmi->ccm_interval_ms * 7) / 2) { bool fault; struct remote_mp *rmp, *rmp_next; struct remote_maid *rmaid, *rmaid_next; -- 2.30.2