You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "wido (via GitHub)" <gi...@apache.org> on 2025/04/17 08:59:53 UTC
Re: [PR] server: check startip and startipv6 of shared network [cloudstack]
wido commented on code in PR #10704:
URL: https://github.com/apache/cloudstack/pull/10704#discussion_r2048540857
##########
server/src/main/java/com/cloud/network/NetworkServiceImpl.java:
##########
@@ -1635,10 +1635,19 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapac
throwInvalidIdException("Network offering with specified id doesn't support adding multiple ip ranges", ntwkOff.getUuid(), NETWORK_OFFERING_ID);
}
- if (GuestType.Shared == ntwkOff.getGuestType() && !ntwkOff.isSpecifyVlan() && Objects.isNull(associatedNetworkId)) {
- throw new CloudRuntimeException("Associated network must be provided when creating Shared networks when specifyVlan is false");
- }
+
+ if (GuestType.Shared == ntwkOff.getGuestType()) {
+ if (!ntwkOff.isSpecifyIpRanges()) {
+ throw new CloudRuntimeException("The 'specifyipranges' parameter should be true for Shared Networks");
+ }
+ if (ipv4 && Objects.isNull(startIP)) {
+ throw new CloudRuntimeException("IPv4 address range needs to be provided");
+ }
+ if (ipv6 && Objects.isNull(startIPv6)) {
+ throw new CloudRuntimeException("IPv6 address range needs to be provided");
+ }
Review Comment:
In shared networks you will never use a start and endip as SLAAC does the work. So these variables will never be used.
The subnet needs to be provided, a /64 and that's it. People can fill in dummy information here, it will not do anything and not break anything
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org