From bb70312ccbb42e48b22c9dc100ea26b0db99edf7 Mon Sep 17 00:00:00 2001 From: Barbudor Date: Tue, 1 Feb 2022 22:15:27 +0100 Subject: [PATCH] fix ethdnsserver overwritten --- tasmota/xdrv_82_esp32_ethernet.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_82_esp32_ethernet.ino b/tasmota/xdrv_82_esp32_ethernet.ino index 57d740b9a..2240e6e04 100644 --- a/tasmota/xdrv_82_esp32_ethernet.ino +++ b/tasmota/xdrv_82_esp32_ethernet.ino @@ -100,8 +100,10 @@ void EthernetEvent(WiFiEvent_t event) { ETH.macAddress().c_str(), (uint32_t)ETH.localIP(), eth_hostname); Settings->eth_ipv4_address[1] = (uint32_t)ETH.gatewayIP(); Settings->eth_ipv4_address[2] = (uint32_t)ETH.subnetMask(); - Settings->eth_ipv4_address[3] = (uint32_t)ETH.dnsIP(); - Settings->eth_ipv4_address[4] = (uint32_t)ETH.dnsIP(1); + if (0 == Settings->eth_ipv4_address[0]) { // At this point ETH.dnsIP() are NOT correct unless DHCP + Settings->eth_ipv4_address[3] = (uint32_t)ETH.dnsIP(); + Settings->eth_ipv4_address[4] = (uint32_t)ETH.dnsIP(1); + } TasmotaGlobal.rules_flag.eth_connected = 1; TasmotaGlobal.global_state.eth_down = 0; break;