Removed goto

This commit is contained in:
CommanderRedYT
2021-11-30 19:27:18 +01:00
parent 4302b8bf5e
commit 3d13cd9946

View File

@@ -22,7 +22,8 @@ void handle_dns_announce()
if (const auto result = wifi_stack::get_ip_info(TCPIP_ADAPTER_IF_STA); result)
{
std::string curIpAddress = wifi_stack::toString(result->ip);
if (curIpAddress == "0.0.0.0") goto lookupIPv6;
if (curIpAddress == "0.0.0.0")
{
if (dns_lastIpAddress_v4 != curIpAddress)
{
dns_lastIpAddress_v4 = curIpAddress;
@@ -38,11 +39,11 @@ void handle_dns_announce()
}
}
}
}
else
{
ESP_LOGW("BOBBY", "get_ip_info() failed with %.*s", result.error().size(), result.error().data());
}
lookupIPv6:
esp_ip6_addr_t tmpv6addr;
if (const auto result = esp_netif_get_ip6_linklocal(wifi_stack::esp_netifs[ESP_IF_WIFI_STA], &tmpv6addr); result == ESP_OK)
{