Bug 1474895 - Only listen on loopback to avoid constant firewall warnings.
authorLogan Smyth <loganfsmyth@gmail.com>
Fri, 05 Oct 2018 02:01:37 +0000
changeset 440009 1bbb6f80f5d9b3275ca9986a276fa1ae510da710
parent 440008 3ded0ccdc4a548190faf633dca587cd11744b6f4
child 440010 b59cdee372577eba70443e114d9996c62f4b51fb
push id70549
push userlsmyth@mozilla.com
push dateMon, 08 Oct 2018 19:54:12 +0000
treeherderautoland@1bbb6f80f5d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1474895
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1474895 - Only listen on loopback to avoid constant firewall warnings. Differential Revision: https://phabricator.services.mozilla.com/D7233
testing/mochitest/ssltunnel/ssltunnel.cpp
--- a/testing/mochitest/ssltunnel/ssltunnel.cpp
+++ b/testing/mochitest/ssltunnel/ssltunnel.cpp
@@ -970,18 +970,20 @@ void StartServer(void* data)
 
   // In case the socket is still open in the TIME_WAIT state from a previous
   // instance of ssltunnel we ask to reuse the port.
   PRSocketOptionData socket_option;
   socket_option.option = PR_SockOpt_Reuseaddr;
   socket_option.value.reuse_addr = true;
   PR_SetSocketOption(listen_socket.get(), &socket_option);
 
+  // Explicitly listen on loopback to avoid users getting errors from their
+  // firewalls about ssltunnel needing permission.
   PRNetAddr server_addr;
-  PR_InitializeNetAddr(PR_IpAddrAny, si->listen_port, &server_addr);
+  PR_InitializeNetAddr(PR_IpAddrLoopback, si->listen_port, &server_addr);
   if (PR_Bind(listen_socket.get(), &server_addr) != PR_SUCCESS) {
     LOG_ERROR(("failed to bind socket on port %d: error %d\n", si->listen_port, PR_GetError()));
     SignalShutdown();
     return;
   }
 
   if (PR_Listen(listen_socket.get(), 1) != PR_SUCCESS) {
     LOG_ERROR(("failed to listen on socket\n"));