From 24d8ccc52f8844d4110df1411e3dafbdc8ec1046 Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 5 Jul 2021 22:55:39 +0200 Subject: [PATCH] fix crash with IPv6 and ETH - #83 --- src/web/WebStatusService.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/web/WebStatusService.cpp b/src/web/WebStatusService.cpp index e1ded7f37..b58eacbb7 100644 --- a/src/web/WebStatusService.cpp +++ b/src/web/WebStatusService.cpp @@ -73,19 +73,23 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) { EMSESP::system_.ethernet_connected(false); break; +#ifndef EMSESP_STANDALONE case SYSTEM_EVENT_STA_CONNECTED: WiFi.enableIpV6(); break; case SYSTEM_EVENT_ETH_CONNECTED: - // ETH.enableIpV6(); // TODO this crashes + ETH.enableIpV6(); break; case SYSTEM_EVENT_GOT_IP6: -#ifndef EMSESP_STANDALONE - EMSESP::logger().info(F("WiFi Connected with IP=%s, hostname=%s"), WiFi.localIPv6().toString().c_str(), WiFi.getHostname()); -#endif + 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()); + } break; +#endif default: break;