mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +01:00
CLOUDSTACK-2694: Able to configure duplicate firewall rule with protocol and no ports
Signed-off-by: Jayapal <jayapal@apache.org>
This commit is contained in:
parent
c76302cdd8
commit
fce2880b9f
@ -404,6 +404,12 @@ public class FirewallManagerImpl extends ManagerBase implements FirewallService,
|
||||
|
||||
boolean notNullPorts =
|
||||
(newRule.getSourcePortStart() != null && newRule.getSourcePortEnd() != null && rule.getSourcePortStart() != null && rule.getSourcePortEnd() != null);
|
||||
boolean nullPorts =
|
||||
(newRule.getSourcePortStart() == null && newRule.getSourcePortEnd() == null && rule.getSourcePortStart() == null && rule.getSourcePortEnd() == null);
|
||||
if(nullPorts && duplicatedCidrs && (rule.getProtocol().equalsIgnoreCase(newRule.getProtocol())))
|
||||
{
|
||||
throw new NetworkRuleConflictException("There is already a firewall rule specified with protocol = " +newRule.getProtocol()+ " and no ports");
|
||||
}
|
||||
if (!notNullPorts) {
|
||||
continue;
|
||||
} else if (!oneOfRulesIsFirewall &&
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user