mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 12:30:50 +01:00
CA-280679: Fixed issue where the TabPage plugin could not handle Ipv6 addresses.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
parent
1febd6f49a
commit
19de8c54b5
@ -35,6 +35,7 @@ using System.Text.RegularExpressions;
|
||||
using XenCenterLib;
|
||||
using XenAdmin.XenSearch;
|
||||
using XenAPI;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace XenAdmin.Plugins
|
||||
{
|
||||
@ -191,7 +192,14 @@ namespace XenAdmin.Plugins
|
||||
return new List<Uri> { new Uri(u) };
|
||||
}
|
||||
|
||||
return ips.ConvertAll(ip => new Uri(u.Replace(string.Format(PlaceholderFormat, ipAddressName), ip.ToString())));
|
||||
return ips.ConvertAll(ip =>
|
||||
{
|
||||
var ipstring = ip.AddressIP != null && ip.AddressIP.AddressFamily == AddressFamily.InterNetworkV6
|
||||
? string.Format("[{0}]", ip)
|
||||
: ip.ToString();
|
||||
|
||||
return new Uri(u.Replace(string.Format(PlaceholderFormat, ipAddressName), ipstring));
|
||||
});
|
||||
}
|
||||
catch (UriFormatException)
|
||||
{
|
||||
|
@ -69,6 +69,8 @@ namespace XenCenterLib
|
||||
get { return partialIP != null; }
|
||||
}
|
||||
|
||||
public IPAddress AddressIP { get { return addressIP; } }
|
||||
|
||||
public static bool TryParse(String candidate, bool allowPartialIP, bool allowName, out ComparableAddress address)
|
||||
{
|
||||
address = null;
|
||||
|
Loading…
Reference in New Issue
Block a user