mirror of
https://github.com/esphome/esphome.git
synced 2026-09-21 20:18:43 +00:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user