You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cloudstack-2511 Multiple_Ip_Ranges: Adding guest ip range in subset/superset to existing CIDR is allowed Cloudstack-2651 [Shared n/w]Add IP range should ask for gateway and netmask
if (!NetUtils.sameSubnet(startIP, vlanGateway, vlanNetmask)) {
2555
-
if (!NetUtils.sameSubnet(endIP, vlanGateway, vlanNetmask)) {
2556
-
// check if the the new subnet is not a superset of the existing subnets.
2557
-
if (NetUtils.isNetworkAWithinNetworkB(NetUtils.getCidrFromGatewayAndNetmask(vlanGateway,vlanNetmask), NetUtils.ipAndNetMaskToCidr(startIP, newVlanNetmask))){
2558
-
thrownewInvalidParameterValueException ("The new subnet is a superset of the existing subnet");
2559
-
}
2560
-
// check if the new subnet is not a subset of the existing subnet.
2561
-
if (NetUtils.isNetworkAWithinNetworkB(NetUtils.ipAndNetMaskToCidr(startIP, newVlanNetmask), NetUtils.getCidrFromGatewayAndNetmask(vlanGateway,vlanNetmask))){
2562
-
thrownewInvalidParameterValueException("The new subnet is a subset of the existing subnet");
// this means that new cidr is a superset of the existing subnet.
2592
+
thrownewInvalidParameterValueException("The subnet you are trying to add is a superset of the existing subnet having gateway"+vlan.getVlanGateway()+" and netmask "+vlan.getVlanNetmask());
2593
+
}
2594
+
elseif (val == 0) {
2595
+
//this implies the user is trying to add a new subnet which is not a superset or subset of this subnet.
2596
+
//checking with the other subnets.
2597
+
continue;
2598
+
}
2599
+
elseif (val == 2) {
2600
+
//this means he is trying to add to the same subnet.
2601
+
thrownewInvalidParameterValueException("The subnet you are trying to add is a subset of the existing subnet having gateway"+vlan.getVlanGateway()+" and netmask "+vlan.getVlanNetmask());
2575
2602
}
2576
-
else {
2577
-
thrownewInvalidParameterValueException("Start ip and End ip is not in vlan range!");
thrownewMissingParameterValueException("The gateway for the new subnet is not specified.");
2595
-
}
2596
-
}
2597
2619
}
2598
-
returnsameSubnet;
2620
+
if (newVlanGateway==null && newVlanNetmask ==null && sameSubnet == false) {
2621
+
thrownewInvalidParameterValueException("The ip range dose not belong to any of the existing subnets, Provide the netmask and gateway if you want to add new subnet");
0 commit comments