You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pe...@apache.org on 2025/01/08 18:01:53 UTC
(cloudstack) branch add-ip-range-checks-sharednet created (now 524fff41aa8)
This is an automated email from the ASF dual-hosted git repository.
pearl11594 pushed a change to branch add-ip-range-checks-sharednet
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
at 524fff41aa8 Add checks if IP range is passed if Shared Network
This branch includes the following new commits:
new 524fff41aa8 Add checks if IP range is passed if Shared Network
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(cloudstack) 01/01: Add checks if IP range is passed if Shared Network
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pearl11594 pushed a commit to branch add-ip-range-checks-sharednet
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 524fff41aa8dc32e25ac62c4e52232ffa58e1c93
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Wed Jan 8 13:01:41 2025 -0500
Add checks if IP range is passed if Shared Network
---
.../src/main/java/com/cloud/network/NetworkServiceImpl.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
index d0711a9fcf9..8dd984c0032 100644
--- a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
@@ -1634,6 +1634,18 @@ 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()) {
+ if (!ntwkOff.isSpecifyIpRanges()) {
+ throw new CloudRuntimeException("Specify IP Ranged 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, privateMtu);