From 2bbaa917f8ba3ed65f4baf3ff6faa61e08e66928 Mon Sep 17 00:00:00 2001 From: Alvin Moore Date: Tue, 17 Sep 2019 12:15:04 -0700 Subject: [PATCH] Switched out C style cast to more favorable type --- flow/Platform.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flow/Platform.cpp b/flow/Platform.cpp index c968a6a417..f0eb3b932d 100644 --- a/flow/Platform.cpp +++ b/flow/Platform.cpp @@ -518,13 +518,13 @@ const char* getInterfaceName(const IPAddress& _ip) { if(!iter->ifa_addr) continue; if (iter->ifa_addr->sa_family == AF_INET && _ip.isV4()) { - uint32_t ip = ntohl((((struct sockaddr_in*)iter->ifa_addr)->sin_addr.s_addr)); + uint32_t ip = ntohl((reinterpret_cast(iter->ifa_addr))->sin_addr.s_addr); if (ip == _ip.toV4()) { ifa_name = iter->ifa_name; break; } } else if (iter->ifa_addr->sa_family == AF_INET6 && _ip.isV6()) { - struct sockaddr_in6* ifa_addr = (struct sockaddr_in6*)iter->ifa_addr; + struct sockaddr_in6* ifa_addr = reinterpret_cast(iter->ifa_addr); if (memcmp(_ip.toV6().data(), &ifa_addr->sin6_addr, 16) == 0) { ifa_name = iter->ifa_name; break;