Unverified Commit 34f386a2 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

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

From @JAndrassy https://github.com/esp8266/Arduino/pull/9173
parent dd1c9095
...@@ -427,6 +427,7 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) { ...@@ -427,6 +427,7 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
template<class RawDev> template<class RawDev>
void LwipIntfDev<RawDev>::end() { void LwipIntfDev<RawDev>::end() {
if (_started) {
if (_intrPin < 0) { if (_intrPin < 0) {
__removeEthernetPacketHandler(_phID); __removeEthernetPacketHandler(_phID);
} else { } else {
...@@ -439,6 +440,7 @@ void LwipIntfDev<RawDev>::end() { ...@@ -439,6 +440,7 @@ void LwipIntfDev<RawDev>::end() {
netif_remove(&_netif); netif_remove(&_netif);
_started = false; _started = false;
}
} }
template<class RawDev> template<class RawDev>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment