createPod/editPod: don't allow gateway to overlap start-end ip range

This commit is contained in:
alena 2011-02-15 18:01:49 -08:00
parent e573e66074
commit 4ae5734ab0
1 changed files with 5 additions and 0 deletions

View File

@ -464,6 +464,11 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
throw new InvalidParameterValueException("The gateway is not in the CIDR subnet.");
}
//Don't allow gateway to overlap with start/endIp
if (NetUtils.ipRangesOverlap(startIp, endIp, gateway, gateway)) {
throw new InvalidParameterValueException("The gateway shouldn't overlap start/end ip addresses");
}
String checkPodCIDRs = _configDao.getValue("check.pod.cidrs");
if (checkPodCIDRs == null || checkPodCIDRs.trim().isEmpty() || Boolean.parseBoolean(checkPodCIDRs)) {
// Check if the CIDR conflicts with the Guest Network or other pods