bug 7344: preventing enabling of static nat on an ip for more than one instance. Check the nat flag, and error out if set

status 7344: resolved fixed
This commit is contained in:
abhishek 2010-11-29 11:55:26 -08:00
parent 28e338ff7e
commit dce3f9fa3b

View File

@ -3146,6 +3146,11 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
throw new PermissionDeniedException("Cannot create a static nat rule for the ip:"+ipAddress.getAddress()+" ,this is already a source nat ip address");
}
//if given ip address is already static nat, return error
if(ipAddress.isOneToOneNat()){
throw new PermissionDeniedException("Cannot create a static nat rule for the ip:"+ipAddress.getAddress()+" ,this is already a static nat ip address");
}
newFwRule = new FirewallRuleVO();
newFwRule.setEnabled(true);
newFwRule.setForwarding(true);