Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/shared/inc/conncheckshared.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ inline unique_socket ConnCheckConnectSocket(int family, const char* hostname, co
auto status = getaddrinfo(hostname, port, &hints, &servinfo);
if (status != 0)
{
if (status == EAI_NODATA || status == EAI_NONAME) // Check for both as EAI_NODATA is deprecated on newr linux versions
{
// EAI_NODATA means the domain exists but lacks records for the requested
// address family (A for IPv4, AAAA for IPv6). This is expected behavior
// for domains that are IPv4-only or IPv6-only.
// This is not treated as an error; we simply skip this address family and
// continue testing the other protocols.
*connCheckStatus = ConnCheckStatus::Success;
}
throw std::runtime_error(std::format("CheckConnection: getaddrinfo() failed: {}", status));
}

Expand Down