mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
server: check startip and endip of shared network (#10704)
revert part of #10168
This commit is contained in:
parent
f13cf597a2
commit
53d3d19606
@ -1635,10 +1635,19 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
|
||||
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");
|
||||
}
|
||||
}
|
||||
Pair<Integer, Integer> interfaceMTUs = validateMtuConfig(publicMtu, privateMtu, zone.getId());
|
||||
mtuCheckForVpcNetwork(vpcId, interfaceMTUs, publicMtu);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user