Browse Source

NET-509

* External client config files with IPv6 endpoints now have the [] separating the address and port.
Farukh Khan 2 năm trước cách đây
mục cha
commit
76d7418cf1
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  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 += ","