================ @@ -116,6 +116,24 @@ bool lldb_private::HostSupportsIPv6() { return CheckIPSupport("IPv6", "[::1]:0"); } +bool lldb_private::HostSupportsLocalhostToIPv4() { + if (!HostSupportsIPv4()) + return false; + + auto addresses = SocketAddress::GetAddressInfo("localhost", nullptr, AF_INET, + SOCK_STREAM, IPPROTO_TCP); + return !addresses.empty(); +} + +bool lldb_private::HostSupportsLocalhostToIPv6() { + if (!HostSupportsIPv6()) + return false; + + auto addresses = SocketAddress::GetAddressInfo("localhost", nullptr, AF_INET6, + SOCK_STREAM, IPPROTO_TCP); ---------------- ashgti wrote:
Thanks for the suggestion! I tried this on my mac by commenting out the `::1 localhost` line in my hosts file, but I wonder if I had some caching or something happening. Applied this suggestion. https://github.com/llvm/llvm-project/pull/118673 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits