cae166
--- nss/cmd/httpserv/httpserv.c.539183	2016-05-21 18:31:39.879585420 -0700
cae166
+++ nss/cmd/httpserv/httpserv.c	2016-05-21 18:37:22.374464057 -0700
cae166
@@ -953,23 +953,23 @@
cae166
 getBoundListenSocket(unsigned short port)
cae166
 {
cae166
     PRFileDesc *listen_sock;
cae166
     int listenQueueDepth = 5 + (2 * maxThreads);
cae166
     PRStatus prStatus;
cae166
     PRNetAddr addr;
cae166
     PRSocketOptionData opt;
cae166
 
cae166
-    addr.inet.family = PR_AF_INET;
cae166
-    addr.inet.ip = PR_INADDR_ANY;
cae166
-    addr.inet.port = PR_htons(port);
cae166
+    if (PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, port, &addr) != PR_SUCCESS) {
cae166
+        errExit("PR_SetNetAddr");
cae166
+    }
cae166
 
cae166
-    listen_sock = PR_NewTCPSocket();
cae166
+    listen_sock = PR_OpenTCPSocket(PR_AF_INET6);
cae166
     if (listen_sock == NULL) {
cae166
-        errExit("PR_NewTCPSocket");
cae166
+        errExit("PR_OpenTCPSockett");
cae166
     }
cae166
 
cae166
     opt.option = PR_SockOpt_Nonblocking;
cae166
     opt.value.non_blocking = PR_FALSE;
cae166
     prStatus = PR_SetSocketOption(listen_sock, &opt;;
cae166
     if (prStatus < 0) {
cae166
         PR_Close(listen_sock);
cae166
         errExit("PR_SetSocketOption(PR_SockOpt_Nonblocking)");
cae166
--- nss/cmd/selfserv/selfserv.c.539183	2016-05-21 18:31:39.882585367 -0700
cae166
+++ nss/cmd/selfserv/selfserv.c	2016-05-21 18:41:43.092801174 -0700
cae166
@@ -1711,23 +1711,23 @@
cae166
 getBoundListenSocket(unsigned short port)
cae166
 {
cae166
     PRFileDesc *listen_sock;
cae166
     int listenQueueDepth = 5 + (2 * maxThreads);
cae166
     PRStatus prStatus;
cae166
     PRNetAddr addr;
cae166
     PRSocketOptionData opt;
cae166
 
cae166
-    addr.inet.family = PR_AF_INET;
cae166
-    addr.inet.ip = PR_INADDR_ANY;
cae166
-    addr.inet.port = PR_htons(port);
cae166
+    if (PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, port, &addr) != PR_SUCCESS) {
cae166
+        errExit("PR_SetNetAddr");
cae166
+    }
cae166
 
cae166
-    listen_sock = PR_NewTCPSocket();
cae166
+    listen_sock = PR_OpenTCPSocket(PR_AF_INET6);
cae166
     if (listen_sock == NULL) {
cae166
-        errExit("PR_NewTCPSocket");
cae166
+        errExit("PR_OpenTCPSocket error");
cae166
     }
cae166
 
cae166
     opt.option = PR_SockOpt_Nonblocking;
cae166
     opt.value.non_blocking = PR_FALSE;
cae166
     prStatus = PR_SetSocketOption(listen_sock, &opt;;
cae166
     if (prStatus < 0) {
cae166
         PR_Close(listen_sock);
cae166
         errExit("PR_SetSocketOption(PR_SockOpt_Nonblocking)");