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 <goldsimon@gmx.de>
This commit is contained in:
David Girault 2019-05-21 15:09:42 +02:00 committed by Simon Goldschmidt
parent eaa8f34f6a
commit e09add37c1

View File

@ -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,