Skip to content

Commit e7ab7e0

Browse files
david-cermakyarrick
authored andcommitted
autoip: Choose next address after rate limit
AutoIP now selects a new address after rate limit timeout, AutoIP tries a new address by incrementing the tried_llipaddr counter in the ACD_DECLINE case of the callback. In lwIP pre-2.2.0, address conflict detection was handled within autoip.c, and the incrementing happened in autoip_restart() (line 150). When ACD was extracted into a separate module in 2.2.0, this increment was missing for the rate-limiting path. Without this change, devices continuously retry the same IP address after rate limiting, causing them to fail Bonjour Conformance Tests.
1 parent b1edb77 commit e7ab7e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/ipv4/autoip.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,10 @@ autoip_conflict_callback(struct netif *netif, acd_callback_enum_t state)
223223
autoip_restart(netif);
224224
break;
225225
case ACD_DECLINE:
226-
/* "delete" conflicting address so a new one will be selected in
227-
* autoip_start() */
226+
/* "delete" conflicting address and increment tried addr so a new one
227+
* will be selected in autoip_start() */
228228
ip4_addr_set_any(&autoip->llipaddr);
229+
autoip->tried_llipaddr++;
229230
autoip_stop(netif);
230231
break;
231232
default:

0 commit comments

Comments
 (0)