f57139
diff -up nss/cmd/httpserv/httpserv.c.539183 nss/cmd/httpserv/httpserv.c
f57139
--- nss/cmd/httpserv/httpserv.c.539183	2013-05-28 14:43:24.000000000 -0700
f57139
+++ nss/cmd/httpserv/httpserv.c	2013-05-30 22:16:46.685373471 -0700
f57139
@@ -661,14 +661,18 @@ getBoundListenSocket(unsigned short port
f57139
     PRStatus	       prStatus;
f57139
     PRNetAddr          addr;
f57139
     PRSocketOptionData opt;
f57139
+    PRUint16           socketDomain = PR_AF_INET;
f57139
 
f57139
-    addr.inet.family = PR_AF_INET;
f57139
-    addr.inet.ip     = PR_INADDR_ANY;
f57139
-    addr.inet.port   = PR_htons(port);
f57139
+    if (PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, port, &addr) != PR_SUCCESS) {
f57139
+	errExit("PR_SetNetAddr");
f57139
+    }
f57139
 
f57139
-    listen_sock = PR_NewTCPSocket();
f57139
+    if (PR_GetEnv("NSS_USE_SDP")) {
f57139
+        socketDomain = PR_AF_INET_SDP;
f57139
+    }
f57139
+    listen_sock = PR_OpenTCPSocket(PR_AF_INET6);
f57139
     if (listen_sock == NULL) {
f57139
-	errExit("PR_NewTCPSocket");
f57139
+	errExit("PR_OpenTCPSocket error");
f57139
     }
f57139
 
f57139
     opt.option = PR_SockOpt_Nonblocking;
f57139
diff -up nss/cmd/selfserv/selfserv.c.539183 nss/cmd/selfserv/selfserv.c
f57139
--- nss/cmd/selfserv/selfserv.c.539183	2013-05-28 14:43:24.000000000 -0700
f57139
+++ nss/cmd/selfserv/selfserv.c	2013-05-30 22:16:46.688373495 -0700
f57139
@@ -1687,14 +1687,18 @@ getBoundListenSocket(unsigned short port
f57139
     PRStatus	       prStatus;
f57139
     PRNetAddr          addr;
f57139
     PRSocketOptionData opt;
f57139
+    PRUint16           socketDomain = PR_AF_INET;
f57139
 
f57139
-    addr.inet.family = PR_AF_INET;
f57139
-    addr.inet.ip     = PR_INADDR_ANY;
f57139
-    addr.inet.port   = PR_htons(port);
f57139
+    if (PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, port, &addr) != PR_SUCCESS) {
f57139
+	errExit("PR_SetNetAddr");
f57139
+    }
f57139
 
f57139
-    listen_sock = PR_NewTCPSocket();
f57139
+    if (PR_GetEnv("NSS_USE_SDP")) {
f57139
+        socketDomain = PR_AF_INET_SDP;
f57139
+    }
f57139
+    listen_sock = PR_OpenTCPSocket(PR_AF_INET6);
f57139
     if (listen_sock == NULL) {
f57139
-	errExit("PR_NewTCPSocket");
f57139
+        errExit("PR_OpenTCPSocket error");
f57139
     }
f57139
 
f57139
     opt.option = PR_SockOpt_Nonblocking;