Fix ESP32 reset during WiFi reconnect when mDNS is active (#24358)

* Fix ESP32 reset during WiFi reconnect when mDNS is active

Explicitly call MDNS.end() before WiFi.disconnect() in support_wifi.ino.
This prevents a race condition or crash where the mDNS service attempts
to query or use the network interface while it is being torn down.

* Fix: removed lines added again.
This commit is contained in:
utessel
2026-02-25 10:39:01 +01:00
committed by GitHub
parent dcf79d3946
commit 518dbee78b
+4
View File
@@ -320,6 +320,10 @@ void WifiBegin(uint8_t flag, uint8_t channel) {
#ifdef USE_WIFI_RANGE_EXTENDER
if (WiFi.getMode() != WIFI_AP_STA || !RgxApUp()) { // Preserve range extender connections (#17103)
#endif // USE_WIFI_RANGE_EXTENDER
#if defined(ESP32) && defined(USE_DISCOVERY)
MDNS.end();
#endif
WiFi.disconnect(true); // Delete SDK wifi config
delay(200);
WifiSetMode(WIFI_STA); // Disable AP mode