diff --git a/socket/socket_tcp6.c b/socket/socket_tcp6.c index f0cfd01..1e6689c 100644 --- a/socket/socket_tcp6.c +++ b/socket/socket_tcp6.c @@ -12,7 +12,7 @@ int socket_tcp6(void) { int s; #if defined(LIBC_HAS_IP6) && defined(SOCK_NONBLOCK) - if ((s=socket(PF_INET6,SOCK_STREAM|SOCK_NONBLOCK,IPPROTO_TCP))>-1 || errno!=EINVAL) return s; + if ((s=socket(noipv6?PF_INET:PF_INET6,SOCK_STREAM|SOCK_NONBLOCK,IPPROTO_TCP))>-1 || errno!=EINVAL) return s; #endif s=socket_tcp6b(); if (s==-1) return -1;