mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
CLOUDSTACK-1786: While reserving IPs in guest network, if guestvmcidr is a subset of network cidr but not a subset of cidr, exception is thrown.
Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
This commit is contained in:
parent
21ce3befc8
commit
ea893eaf33
@ -1868,11 +1868,13 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
|
||||
|
||||
// If networkCidr is null it implies that there was no prior IP reservation, so the network cidr is network.getCidr()
|
||||
// But in case networkCidr is a non null value (IP reservation already exists), it implies network cidr is networkCidr
|
||||
if (networkCidr != null && ! NetUtils.isNetworkAWithinNetworkB(guestVmCidr, networkCidr)) {
|
||||
if (networkCidr != null) {
|
||||
if(! NetUtils.isNetworkAWithinNetworkB(guestVmCidr, networkCidr)) {
|
||||
throw new InvalidParameterValueException ("Invalid value of Guest VM CIDR. For IP Reservation, Guest VM CIDR should be a subset of network CIDR : " + networkCidr);
|
||||
}
|
||||
} else {
|
||||
if (! NetUtils.isNetworkAWithinNetworkB(guestVmCidr, network.getCidr())) {
|
||||
throw new InvalidParameterValueException ("Invalid value of Guest VM CIDR. For IP Reservation, Guest VM CIDR should be a subset of network CIDR : " + network.getCidr());
|
||||
throw new InvalidParameterValueException ("Invalid value of Guest VM CIDR. For IP Reservation, Guest VM CIDR should be a subset of network CIDR : " + network.getCidr());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user