fix crash with IPv6 and ETH - #83

This commit is contained in:
proddy
2021-07-05 22:55:39 +02:00
parent 05cd96f2be
commit 24d8ccc52f

View File

@@ -73,19 +73,23 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) {
EMSESP::system_.ethernet_connected(false); EMSESP::system_.ethernet_connected(false);
break; break;
#ifndef EMSESP_STANDALONE
case SYSTEM_EVENT_STA_CONNECTED: case SYSTEM_EVENT_STA_CONNECTED:
WiFi.enableIpV6(); WiFi.enableIpV6();
break; break;
case SYSTEM_EVENT_ETH_CONNECTED: case SYSTEM_EVENT_ETH_CONNECTED:
// ETH.enableIpV6(); // TODO this crashes ETH.enableIpV6();
break; break;
case SYSTEM_EVENT_GOT_IP6: case SYSTEM_EVENT_GOT_IP6:
#ifndef EMSESP_STANDALONE if (EMSESP::system_.ethernet_connected()) {
EMSESP::logger().info(F("Ethernet Connected with IP=%s, speed %d Mbps"), ETH.localIPv6().toString().c_str(), ETH.linkSpeed());
} else {
EMSESP::logger().info(F("WiFi Connected with IP=%s, hostname=%s"), WiFi.localIPv6().toString().c_str(), WiFi.getHostname()); EMSESP::logger().info(F("WiFi Connected with IP=%s, hostname=%s"), WiFi.localIPv6().toString().c_str(), WiFi.getHostname());
#endif }
break; break;
#endif
default: default:
break; break;