From e09add37c122864fbb027abf7a5702282f4708f7 Mon Sep 17 00:00:00 2001 From: David Girault Date: Tue, 21 May 2019 15:09:42 +0200 Subject: [PATCH] acd: fix MAX_CONFLICTS check accorting RFC. As written in RFC5227 in 2.1.1 Probe Details: A host implementing this specification MUST take precautions to limit the rate at which it probes for new candidate addresses: if the host experiences MAX_CONFLICTS or more address conflicts on a given interface, then the host MUST limit the rate at which it probes for new addresses on this interface to no more than one attempted new address per RATE_LIMIT_INTERVAL. But `acd_restart` restart function check for `acd->num_conflicts > MAX_CONFLICTS` which allow one more probe than expected. So this commit change the test to `acd->num_conflicts >= MAX_CONFLICTS`. Signed-off-by: Simon Goldschmidt --- src/core/ipv4/acd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ipv4/acd.c b/src/core/ipv4/acd.c index 138859a7..6208245f 100644 --- a/src/core/ipv4/acd.c +++ b/src/core/ipv4/acd.c @@ -319,7 +319,7 @@ acd_restart(struct netif *netif, struct acd *acd) /* if we tried more then MAX_CONFLICTS we must limit our rate for * acquiring and probing addresses. compliant to RFC 5227 Section 2.1.1 */ - if (acd->num_conflicts > MAX_CONFLICTS) { + if (acd->num_conflicts >= MAX_CONFLICTS) { acd->state = ACD_STATE_RATE_LIMIT; acd->ttw = (u16_t)(RATE_LIMIT_INTERVAL * ACD_TICKS_PER_SECOND); LWIP_DEBUGF(ACD_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | LWIP_DBG_LEVEL_WARNING,