From e7ab7e0773268c0274d96f4bcc43da72691c1d07 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Thu, 28 Nov 2024 12:51:10 +0100 Subject: [PATCH] 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. --- src/core/ipv4/autoip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/ipv4/autoip.c b/src/core/ipv4/autoip.c index 461a0053..ea3f411c 100644 --- a/src/core/ipv4/autoip.c +++ b/src/core/ipv4/autoip.c @@ -223,9 +223,10 @@ autoip_conflict_callback(struct netif *netif, acd_callback_enum_t state) autoip_restart(netif); break; case ACD_DECLINE: - /* "delete" conflicting address so a new one will be selected in - * autoip_start() */ + /* "delete" conflicting address and increment tried addr so a new one + * will be selected in autoip_start() */ ip4_addr_set_any(&autoip->llipaddr); + autoip->tried_llipaddr++; autoip_stop(netif); break; default: