if (m_tcpParameters.value().bindIPAddress.size() > 0)
{
/* Convert mSocketPath to a number in network byte order */
if (!inet_aton(m_tcpParameters.value().bindIPAddress.c_str(), &listenAddr.sin_addr))
{
DCGM_LOG_ERROR << "Unable to convert \"" << m_tcpParameters.value().bindIPAddress
<< "\" to a network address.";
close(m_tcpListenSocketFd);
m_tcpListenSocketFd = -1;
return DCGM_ST_GENERIC_ERROR;
}
}
inet_aton cannot parse IPv6 Address, we need use inet_pton
DCGM cannot listen on v6 address.
inet_aton
cannot parse IPv6 Address, we need useinet_pton