[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413510#comment-16413510
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10221:
---------------------------------------------

DaanHoogland closed pull request #2397: CLOUDSTACK-10221: Allow IPv6 when 
creating a Basic Network
URL: https://github.com/apache/cloudstack/pull/2397
 
 
   

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/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
 
b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index cec2e5926c1..1b707c3979d 100644
--- 
a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ 
b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -38,6 +38,7 @@
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import com.cloud.utils.StringUtils;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
@@ -2116,16 +2117,12 @@ public Network createGuestNetwork(final long 
networkOfferingId, final String nam
 
         boolean ipv6 = false;
 
-        if (ip6Gateway != null && ip6Cidr != null) {
+        if (StringUtils.isNotBlank(ip6Gateway) && 
StringUtils.isNotBlank(ip6Cidr)) {
             ipv6 = true;
         }
         // Validate zone
         final DataCenterVO zone = _dcDao.findById(zoneId);
         if (zone.getNetworkType() == NetworkType.Basic) {
-            if (ipv6) {
-                throw new InvalidParameterValueException("IPv6 is not 
supported in Basic zone");
-            }
-
             // In Basic zone the network should have aclType=Domain, 
domainId=1, subdomainAccess=true
             if (aclType == null || aclType != ACLType.Domain) {
                 throw new InvalidParameterValueException("Only AclType=Domain 
can be specified for network creation in Basic zone");
@@ -2188,6 +2185,10 @@ public Network createGuestNetwork(final long 
networkOfferingId, final String nam
             }
         }
 
+        if (ipv6 && !NetUtils.isValidIp6Cidr(ip6Cidr)) {
+            throw new InvalidParameterValueException("Invalid IPv6 cidr 
specified");
+        }
+
         //TODO(VXLAN): Support VNI specified
         // VlanId can be specified only when network offering supports it
         final boolean vlanSpecified = vlanId != null;
@@ -2328,7 +2329,7 @@ public Network doInTransaction(final TransactionStatus 
status) {
                     userNetwork.setGateway(gateway);
                 }
 
-                if (ip6Cidr != null && ip6Gateway != null) {
+                if (StringUtils.isNotBlank(ip6Gateway) && 
StringUtils.isNotBlank(ip6Cidr)) {
                     userNetwork.setIp6Cidr(ip6Cidr);
                     userNetwork.setIp6Gateway(ip6Gateway);
                 }


 

----------------------------------------------------------------
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:
us...@infra.apache.org


> Allow specification of IPv6 details when creating Basic Network
> ---------------------------------------------------------------
>
>                 Key: CLOUDSTACK-10221
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10221
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: Management Server, Network Controller
>    Affects Versions: 4.10.0.0, 4.11.0.0
>         Environment: Basic Networking with IPv6
>            Reporter: Wido den Hollander
>            Priority: Major
>
> Currently IPv6 details can't be supplied when creating a Basic Network as 
> this will error out.
> Basic Networking does support IPv6 so this restriction can be removed



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to