LwIpIntfDev.end() check _started to prevent crash (#2304)

From @JAndrassy https://github.com/esp8266/Arduino/pull/9173
This commit is contained in:
Earle F. Philhower, III 2024-07-27 11:46:39 -07:00 committed by GitHub
parent dd1c9095e8
commit 34f386a21b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -427,18 +427,20 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
template<class RawDev>
void LwipIntfDev<RawDev>::end() {
if (_intrPin < 0) {
__removeEthernetPacketHandler(_phID);
} else {
detachInterrupt(_intrPin);
__removeEthernetGPIO(_intrPin);
if (_started) {
if (_intrPin < 0) {
__removeEthernetPacketHandler(_phID);
} else {
detachInterrupt(_intrPin);
__removeEthernetGPIO(_intrPin);
}
RawDev::end();
netif_remove(&_netif);
_started = false;
}
RawDev::end();
netif_remove(&_netif);
_started = false;
}
template<class RawDev>