rhtyd closed pull request #2157: CLOUDSTACK-9961: Fixed adding domain in vpn 
customer gateway
URL: https://github.com/apache/cloudstack/pull/2157
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java 
b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
index e465bfb3529..ba8c1d1ade0 100644
--- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
@@ -177,8 +177,8 @@ public Site2SiteCustomerGateway 
createCustomerGateway(CreateVpnCustomerGatewayCm
 
         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 Site2SiteCustomerGateway 
updateCustomerGateway(UpdateVpnCustomerGatewayCm
         }
         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;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to