From f4183778e365c7c2ae8035f549ab43c5114b87dd Mon Sep 17 00:00:00 2001 From: Otto winter Date: Thu, 3 Feb 2022 09:22:59 +0100 Subject: [PATCH] simplify --- esphome/components/socket/lwip_getaddrinfo_impl.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/esphome/components/socket/lwip_getaddrinfo_impl.cpp b/esphome/components/socket/lwip_getaddrinfo_impl.cpp index d37087ad11..9bda4b944d 100644 --- a/esphome/components/socket/lwip_getaddrinfo_impl.cpp +++ b/esphome/components/socket/lwip_getaddrinfo_impl.cpp @@ -70,13 +70,7 @@ class LwipGetaddrinfoFuture : public GetaddrinfoFuture { struct addrinfo *ai = reinterpret_cast(storage); struct sockaddr_storage *sa = reinterpret_cast(ai + 1); -#if LWIP_IPV4 && LWIP_IPV6 - bool isipv6 = result_->ipaddr.type == IPADDR_TYPE_V6; -#elif LWIP_IPV4 - bool isipv6 = false; -#elif LWIP_IPV6 - bool isipv6 = true; -#endif + bool isipv6 = IP_IS_V6(result_->ipaddr); bool istcp = true; if ((hint_ai_socktype_ != 0 && hint_ai_socktype_ == SOCK_DGRAM) ||