summaryrefslogtreecommitdiff
path: root/ext/socket/ipsocket.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/ipsocket.c')
-rw-r--r--ext/socket/ipsocket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/socket/ipsocket.c b/ext/socket/ipsocket.c
index 78c85766ee..35025803a9 100644
--- a/ext/socket/ipsocket.c
+++ b/ext/socket/ipsocket.c
@@ -58,6 +58,10 @@ init_inetsock_internal(struct inetsock_arg *arg)
arg->fd = fd = -1;
for (res = arg->remote.res; res; res = res->ai_next) {
+#if !defined(INET6) && defined(AF_INET6)
+ if (res->ai_family == AF_INET6)
+ continue;
+#endif
status = rsock_socket(res->ai_family,res->ai_socktype,res->ai_protocol);
syscall = "socket(2)";
fd = status;