From c1b31b353dd5645ba720d984e8029f644d022d66 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 5 Sep 2026 22:25:20 +0200 Subject: [PATCH] [mdns] Note that update() and close() cannot replace the UdpContext --- esphome/components/mdns/mdns_esp8266.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/mdns/mdns_esp8266.cpp b/esphome/components/mdns/mdns_esp8266.cpp index f1e6356efe..0e600d3bac 100644 --- a/esphome/components/mdns/mdns_esp8266.cpp +++ b/esphome/components/mdns/mdns_esp8266.cpp @@ -30,7 +30,9 @@ class GuardedMDNSResponder : public ::esp8266::MDNSImplementation::MDNSResponder (this->*fn)(); return; } - // Set every time: a restart replaces the context together with its stock handler + // Set every time: a restart replaces the context together with its stock handler. Only + // begin() and the scheduled netif callback restart, never update() or close(), so the + // context cannot change underneath this call. ctx->onRx([this]() { if (!this->in_loop_call_) { this->_callProcess();