Skip to content

Commit 97882eb

Browse files
author
SudharmaJain
committed
CLOUDSTACK-8969 VPN customer gateway can't be registered with hostname
1 parent 0827e1f commit 97882eb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ public Site2SiteCustomerGateway createCustomerGateway(CreateVpnCustomerGatewayCm
179179

180180
String name = cmd.getName();
181181
String gatewayIp = cmd.getGatewayIp();
182-
if (!NetUtils.isValidIp(gatewayIp)) {
183-
throw new InvalidParameterValueException("The customer gateway ip " + gatewayIp + " is invalid!");
182+
if (!NetUtils.isValidIp(gatewayIp) && !NetUtils.verifyDomainName(gatewayIp)) {
183+
throw new InvalidParameterValueException("The customer gateway ip/Domain " + gatewayIp + " is invalid!");
184184
}
185185
if (name == null) {
186186
name = "VPN-" + gatewayIp;
@@ -428,8 +428,8 @@ public Site2SiteCustomerGateway updateCustomerGateway(UpdateVpnCustomerGatewayCm
428428
}
429429
String name = cmd.getName();
430430
String gatewayIp = cmd.getGatewayIp();
431-
if (!NetUtils.isValidIp(gatewayIp)) {
432-
throw new InvalidParameterValueException("The customer gateway ip " + gatewayIp + " is invalid!");
431+
if (!NetUtils.isValidIp(gatewayIp) && !NetUtils.verifyDomainName(gatewayIp)) {
432+
throw new InvalidParameterValueException("The customer gateway ip/Domain " + gatewayIp + " is invalid!");
433433
}
434434
if (name == null) {
435435
name = "VPN-" + gatewayIp;

0 commit comments

Comments
 (0)