[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.
This commit is contained in:
J. Nick Koston
2026-03-14 17:13:52 -10:00
parent 90c10103b8
commit 51c61c354c
@@ -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;