From a8ff7d2ab305c4669f0db016331afcf2887706d8 Mon Sep 17 00:00:00 2001 From: Nachiket Kukade Date: Fri, 17 Jul 2026 12:24:31 +0530 Subject: [PATCH] fix(nan): Guard netif calls in NAN_STARTED default event handler - Commit 08e98f6f3015 utilises CONFIG_LWIP_ND6_SUPPORT_STATIC_ENTRIES for adding static entries. - It moves netif calls that generate GOT IPv6 to NAN_STARTED default handler without guard, but guards the removal in NDP Confirm handler - Fix the possible duplicate calls by putting calls from NAN_STARTED handler under CONFIG_LWIP_ND6_SUPPORT_STATIC_ENTRIES guard --- components/esp_wifi/src/wifi_default.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/esp_wifi/src/wifi_default.c b/components/esp_wifi/src/wifi_default.c index c73f4294abc..3798a647ac8 100644 --- a/components/esp_wifi/src/wifi_default.c +++ b/components/esp_wifi/src/wifi_default.c @@ -187,8 +187,10 @@ static void wifi_default_action_nan_started(void *arg, esp_event_base_t base, in /* Bring the netif up before esp_netif_create_ip6_linklocal() (a no-op unless * netif_is_up()). esp_netif_up() is private, so use the public action handler; * NAN is non-DHCP, so it only calls esp_netif_up() and ignores the event args. */ +#if CONFIG_LWIP_ND6_SUPPORT_STATIC_ENTRIES esp_netif_action_connected(s_wifi_netifs[WIFI_IF_NAN], NULL, 0, NULL); esp_netif_create_ip6_linklocal(s_wifi_netifs[WIFI_IF_NAN]); +#endif } }