summaryrefslogtreecommitdiff
path: root/pr/src/io/prsocket.c
diff options
context:
space:
mode:
Diffstat (limited to 'pr/src/io/prsocket.c')
-rw-r--r--pr/src/io/prsocket.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/pr/src/io/prsocket.c b/pr/src/io/prsocket.c
index 8be198fa..629106db 100644
--- a/pr/src/io/prsocket.c
+++ b/pr/src/io/prsocket.c
@@ -199,6 +199,13 @@ PRFileDesc *fd;
if (fd != NULL) {
_PR_MD_MAKE_NONBLOCK(fd);
_PR_MD_INIT_FD_INHERITABLE(fd, PR_TRUE);
+#ifdef _PR_NEED_SECRET_AF
+ /* this means we can only import IPv4 sockets here.
+ * but this is what the function in ptio.c does.
+ * We need a way to import IPv6 sockets, too.
+ */
+ fd->secret->af = AF_INET;
+#endif
} else
_PR_MD_CLOSE_SOCKET(osfd);
return(fd);
@@ -514,6 +521,9 @@ PRIntervalTime timeout)
if (AF_INET6 == addr->raw.family)
addr->raw.family = PR_AF_INET6;
#endif
+#ifdef _PR_NEED_SECRET_AF
+ fd2->secret->af = fd->secret->af;
+#endif
}
return fd2;
}
@@ -943,6 +953,9 @@ PRIntervalTime timeout)
if (AF_INET6 == *raddr->raw.family)
*raddr->raw.family = PR_AF_INET6;
#endif
+#ifdef _PR_NEED_SECRET_AF
+ (*nd)->secret->af = sd->secret->af;
+#endif
}
}
return rv;
@@ -994,6 +1007,9 @@ void *callbackArg)
if (AF_INET6 == *raddr->raw.family)
*raddr->raw.family = PR_AF_INET6;
#endif
+#ifdef _PR_NEED_SECRET_AF
+ (*nd)->secret->af = sd->secret->af;
+#endif
}
}
return rv;
@@ -1312,6 +1328,9 @@ PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRInt32 domain, PRInt32 type, PRInt32 proto)
if (fd != NULL) {
_PR_MD_MAKE_NONBLOCK(fd);
_PR_MD_INIT_FD_INHERITABLE(fd, PR_FALSE);
+#ifdef _PR_NEED_SECRET_AF
+ fd->secret->af = domain;
+#endif
#if defined(_PR_INET6_PROBE) || !defined(_PR_INET6)
/*
* For platforms with no support for IPv6