CLOUDSTACK-8969: VPN customer gateway can't be registered with hostname (#955)

When we have VPN customer gateway which is resolved by a hostname , we should be able to register the VPN customer gateway with its hostname instead of the IP address, this would be useful in case where the remote device IP is dynamically assigned , where customers use DDNS to resolve it.
This commit is contained in:
SudharmaJain 2017-09-13 10:29:08 +05:30 committed by Rohit Yadav
parent 48fa20698e
commit c4ca420f66
1 changed files with 4 additions and 4 deletions

View File

@ -177,8 +177,8 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
String name = cmd.getName();
String gatewayIp = cmd.getGatewayIp();
if (!NetUtils.isValidIp(gatewayIp)) {
throw new InvalidParameterValueException("The customer gateway ip " + gatewayIp + " is invalid!");
if (!NetUtils.isValidIp(gatewayIp) && !NetUtils.verifyDomainName(gatewayIp)) {
throw new InvalidParameterValueException("The customer gateway ip/Domain " + gatewayIp + " is invalid!");
}
if (name == null) {
name = "VPN-" + gatewayIp;
@ -431,8 +431,8 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
}
String name = cmd.getName();
String gatewayIp = cmd.getGatewayIp();
if (!NetUtils.isValidIp(gatewayIp)) {
throw new InvalidParameterValueException("The customer gateway ip " + gatewayIp + " is invalid!");
if (!NetUtils.isValidIp(gatewayIp) && !NetUtils.verifyDomainName(gatewayIp)) {
throw new InvalidParameterValueException("The customer gateway ip/Domain " + gatewayIp + " is invalid!");
}
if (name == null) {
name = "VPN-" + gatewayIp;