Fix for bug 402669 . Crash in PR_Socket with IPv6 emulation on VMS and WinNT . Patch created by Nelson. r=julien, wtc
authorjulien.pierre.boogz%sun.com
Wed, 07 Nov 2007 02:34:30 +0000
changeset 3878 5158f39b66eb492a0d28646eb10b12a48ff54f39
parent 3875 0e5c7f8db0c67594c5456c538a584ef776982306
child 3894 68551a05e6801fecc74d87ab2fb56ac5745cec5e
push idunknown
push userunknown
push dateunknown
reviewersjulien, wtc
bugs402669
Fix for bug 402669 . Crash in PR_Socket with IPv6 emulation on VMS and WinNT . Patch created by Nelson. r=julien, wtc
pr/src/io/prsocket.c
--- a/pr/src/io/prsocket.c
+++ b/pr/src/io/prsocket.c
@@ -1324,31 +1324,31 @@ PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRIn
 	else
 		fd = PR_AllocFileDesc(osfd, PR_GetUDPMethods());
 	/*
 	 * Make the sockets non-blocking
 	 */
 	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 
 		 * create layered socket for IPv4-mapped IPv6 addresses
 		 */
 		if (PR_AF_INET6 == tmp_domain && PR_AF_INET == domain) {
 			if (PR_FAILURE == _pr_push_ipv6toipv4_layer(fd)) {
 				PR_Close(fd);
 				fd = NULL;
 			}
 		}
 #endif
-#ifdef _PR_NEED_SECRET_AF
-		fd->secret->af = domain;
-#endif
 	} else
 		_PR_MD_CLOSE_SOCKET(osfd);
 
 	return fd;
 }
 
 PR_IMPLEMENT(PRFileDesc *) PR_NewTCPSocket(void)
 {