nss-539183.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. diff -up nss/cmd/httpserv/httpserv.c.539183 nss/cmd/httpserv/httpserv.c
  2. --- nss/cmd/httpserv/httpserv.c.539183 2013-05-28 14:43:24.000000000 -0700
  3. +++ nss/cmd/httpserv/httpserv.c 2013-05-30 22:16:46.685373471 -0700
  4. @@ -661,14 +661,18 @@ getBoundListenSocket(unsigned short port
  5. PRStatus prStatus;
  6. PRNetAddr addr;
  7. PRSocketOptionData opt;
  8. + PRUint16 socketDomain = PR_AF_INET;
  9. - addr.inet.family = PR_AF_INET;
  10. - addr.inet.ip = PR_INADDR_ANY;
  11. - addr.inet.port = PR_htons(port);
  12. + if (PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, port, &addr) != PR_SUCCESS) {
  13. + errExit("PR_SetNetAddr");
  14. + }
  15. - listen_sock = PR_NewTCPSocket();
  16. + if (PR_GetEnv("NSS_USE_SDP")) {
  17. + socketDomain = PR_AF_INET_SDP;
  18. + }
  19. + listen_sock = PR_OpenTCPSocket(PR_AF_INET6);
  20. if (listen_sock == NULL) {
  21. - errExit("PR_NewTCPSocket");
  22. + errExit("PR_OpenTCPSocket error");
  23. }
  24. opt.option = PR_SockOpt_Nonblocking;
  25. diff -up nss/cmd/selfserv/selfserv.c.539183 nss/cmd/selfserv/selfserv.c
  26. --- nss/cmd/selfserv/selfserv.c.539183 2013-05-28 14:43:24.000000000 -0700
  27. +++ nss/cmd/selfserv/selfserv.c 2013-05-30 22:16:46.688373495 -0700
  28. @@ -1687,14 +1687,18 @@ getBoundListenSocket(unsigned short port
  29. PRStatus prStatus;
  30. PRNetAddr addr;
  31. PRSocketOptionData opt;
  32. + PRUint16 socketDomain = PR_AF_INET;
  33. - addr.inet.family = PR_AF_INET;
  34. - addr.inet.ip = PR_INADDR_ANY;
  35. - addr.inet.port = PR_htons(port);
  36. + if (PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, port, &addr) != PR_SUCCESS) {
  37. + errExit("PR_SetNetAddr");
  38. + }
  39. - listen_sock = PR_NewTCPSocket();
  40. + if (PR_GetEnv("NSS_USE_SDP")) {
  41. + socketDomain = PR_AF_INET_SDP;
  42. + }
  43. + listen_sock = PR_OpenTCPSocket(PR_AF_INET6);
  44. if (listen_sock == NULL) {
  45. - errExit("PR_NewTCPSocket");
  46. + errExit("PR_OpenTCPSocket error");
  47. }
  48. opt.option = PR_SockOpt_Nonblocking;