The following lines will directly return timeout in Non-timeout without attempting additional addresses:
|
if (err == NULL || timeout_iszero(tm)) { |
According to RFC 8305, the current getaddrinfo function will return both AF_INET6 and AF_INET addresses when dual-stack is enabled.
Issue: When a dual-stack client attempts to connect in Non-timeout mode to a server listening only on an IPv4 address, the connection becomes unreachable.
Recommendation: Add more options to control address selection during connect.