rootnomad commented on code in PR #14217:
URL: https://github.com/apache/cloudstack/pull/14217#discussion_r4772431484


##########
server/src/main/java/com/cloud/network/NetworkServiceImpl.java:
##########
@@ -2682,10 +2682,23 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) 
throws InsufficientCapac
             }
         }
 
+        // For an isolated network a start/end IP defines a custom DHCP range 
within the CIDR that guest IPs are
+        // allocated from; without it the whole CIDR is used, which is the 
default. Validate it up front so a bad
+        // range is rejected before the network is persisted, rather than 
throwing after commit and leaving an
+        // orphaned network.
+        boolean hasIsolatedDhcpRange = ntwkOff.getGuestType() == 
GuestType.Isolated && StringUtils.isNotBlank(startIP);
+        if (hasIsolatedDhcpRange) {
+            validateIsolatedNetworkDhcpRange(startIP, endIP, cidr, gateway);
+        }

Review Comment:
   Done in 91b95d24d4d.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to