Fix for bug 402669 . Fix crash in PR_Socket with IPv6 emulation . Patch written by Nelson Bolyard. r=julien,wtc NSPR_4_6_BRANCH
authorjulien.pierre.boogz%sun.com
Wed, 07 Nov 2007 22:24:04 +0000
branchNSPR_4_6_BRANCH
changeset 3879 cf8bcd61c645783a02ee20e2cd55beabc2bf9608
parent 3877 2f7f4b806f683f42092310380db4f190958c55b8
child 3880 466fec8c967793ea20b610aa6962150bc1992c08
child 3893 2355acb363523e4149504ff75d1ca1384b04dc01
push idunknown
push userunknown
push dateunknown
reviewersjulien, wtc
bugs402669
Fix for bug 402669 . Fix crash in PR_Socket with IPv6 emulation . Patch written by Nelson Bolyard. r=julien,wtc
pr/src/io/prsocket.c
--- a/pr/src/io/prsocket.c
+++ b/pr/src/io/prsocket.c
@@ -1323,31 +1323,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)
 {