From 51c61c354cb14f6cb769fd0c39b617c0ac379b26 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 14 Mar 2026 17:13:52 -1000 Subject: [PATCH] [ethernet] Add LwIPLock to get_ip_addresses() on RP2040 localIP() reads netif->ip_addr which can be mutated by DHCP callbacks from IRQ context. Lock for consistency since this is called from API responses, not just hot-loop polling. --- esphome/components/ethernet/ethernet_component_rp2040.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/esphome/components/ethernet/ethernet_component_rp2040.cpp b/esphome/components/ethernet/ethernet_component_rp2040.cpp index c4f7aceac8e..f47f57cb326 100644 --- a/esphome/components/ethernet/ethernet_component_rp2040.cpp +++ b/esphome/components/ethernet/ethernet_component_rp2040.cpp @@ -180,6 +180,7 @@ void EthernetComponent::dump_config() { network::IPAddresses EthernetComponent::get_ip_addresses() { network::IPAddresses addresses; if (this->eth_ != nullptr) { + LwIPLock lock; addresses[0] = network::IPAddress(this->eth_->localIP()); } return addresses;