Explorar el Código

NET-509

* External client config files with IPv6 endpoints now have the [] separating the address and port.
Farukh Khan hace 2 años
padre
commit
76d7418cf1
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      controllers/ext_client.go

+ 6 - 1
controllers/ext_client.go

@@ -217,7 +217,12 @@ func getExtClientConf(w http.ResponseWriter, r *http.Request) {
 	if network.DefaultKeepalive != 0 {
 		keepalive = "PersistentKeepalive = " + strconv.Itoa(int(network.DefaultKeepalive))
 	}
-	gwendpoint := host.EndpointIP.String() + ":" + strconv.Itoa(host.ListenPort)
+	gwendpoint := ""
+	if host.EndpointIP.To4() == nil {
+		gwendpoint = "[" + host.EndpointIP.String() + "]" + ":" + strconv.Itoa(host.ListenPort)
+	} else {
+		gwendpoint = host.EndpointIP.String() + ":" + strconv.Itoa(host.ListenPort)
+	}
 	newAllowedIPs := network.AddressRange
 	if newAllowedIPs != "" && network.AddressRange6 != "" {
 		newAllowedIPs += ","