From 2dfec2ec4d8c0bb4bd806cc2bf9a57f56b0faf60 Mon Sep 17 00:00:00 2001 From: Barbudor Date: Tue, 16 Mar 2021 22:28:39 +0100 Subject: [PATCH] don't keep 0xFFFFFFFF as a valid addres in case of DNS fail --- tasmota/support.ino | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasmota/support.ino b/tasmota/support.ino index b1653ff2a..ff6a0aecf 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -2137,8 +2137,11 @@ void SyslogAsync(bool refresh) { if (mxtime > 0) { uint32_t current_hash = GetHash(SettingsText(SET_SYSLOG_HOST), strlen(SettingsText(SET_SYSLOG_HOST))); if (syslog_host_hash != current_hash) { + IPAddress temp_syslog_host_addr; + int ret = WiFi.hostByName(SettingsText(SET_SYSLOG_HOST), temp_syslog_host_addr); // If sleep enabled this might result in exception so try to do it once using hash + if (!ret) return; syslog_host_hash = current_hash; - WiFi.hostByName(SettingsText(SET_SYSLOG_HOST), syslog_host_addr); // If sleep enabled this might result in exception so try to do it once using hash + syslog_host_addr = temp_syslog_host_addr; } if (!PortUdp.beginPacket(syslog_host_addr, Settings.syslog_port)) { TasmotaGlobal.syslog_level = 0;