Przeglądaj źródła

Fix: also check for IPv6 wildcard address

Rod Hynes 4 lat temu
rodzic
commit
749d7c6538
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      psiphon/net_windows.go

+ 2 - 2
psiphon/net_windows.go

@@ -49,11 +49,11 @@ func makeLocalProxyListener(listenIP string, port int) (net.Listener, bool, erro
 			var controlErr error
 			err := c.Control(func(fd uintptr) {
 
-				if listenIP != "0.0.0.0" {
+				if listenIP != "0.0.0.0" && listenIP != "::" {
 					return
 				}
 
-				// When binding to the wildcard IP address, 0.0.0.0, set
+				// When binding to a wildcard IP address, 0.0.0.0 or ::, set
 				// SO_EXCLUSIVEADDRUSE since Windows, in this case, otherwise
 				// allows other programs to bind to a specific IP address
 				// (e.g., 127.0.0.1) with the same port number and we'll