forked from wolfSSL/wolfssl
wolfio: request only IPv4 addresses unless IPv6 support is enabled
This commit is contained in:
@ -1106,7 +1106,11 @@ int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip, word16 port, int to_sec)
|
|||||||
/* use gethostbyname for c99 */
|
/* use gethostbyname for c99 */
|
||||||
#if defined(HAVE_GETADDRINFO)
|
#if defined(HAVE_GETADDRINFO)
|
||||||
XMEMSET(&hints, 0, sizeof(hints));
|
XMEMSET(&hints, 0, sizeof(hints));
|
||||||
|
#ifdef WOLFSSL_IPV6
|
||||||
hints.ai_family = AF_UNSPEC; /* detect IPv4 or IPv6 */
|
hints.ai_family = AF_UNSPEC; /* detect IPv4 or IPv6 */
|
||||||
|
#else
|
||||||
|
hints.ai_family = AF_INET; /* detect only IPv4 */
|
||||||
|
#endif
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
hints.ai_protocol = IPPROTO_TCP;
|
hints.ai_protocol = IPPROTO_TCP;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user