the current code iterates only thru the returned list of getaddrinfo if socket operation is successful. That might not the case for AF_INET6 if IPV6 is disabled in the kernel (as per issue report).
The proposal push is a fix using for loop similar to the example approach of man 3 getaddrinfo and move the error handling outside of the loop to make sure we try to connect with all possible addresses returned first. I would leave it to you how to final integrate. This will fix some change behavior that seem to come with 13.0-FREEBSD not returning "in order" the preferred protocol version, but also adds support to "try all connections" which can help in situation where both protocols are configured but only one can reach the destination.
the current code iterates only thru the returned list of getaddrinfo if socket operation is successful. That might not the case for AF_INET6 if IPV6 is disabled in the kernel (as per issue report). The proposal push is a fix using
for
loop similar to the example approach ofman 3 getaddrinfo
and move the error handling outside of the loop to make sure we try to connect with all possible addresses returned first. I would leave it to you how to final integrate. This will fix some change behavior that seem to come with 13.0-FREEBSD not returning "in order" the preferred protocol version, but also adds support to "try all connections" which can help in situation where both protocols are configured but only one can reach the destination.