You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ja...@apache.org on 2014/08/05 14:28:35 UTC
git commit: updated refs/heads/master to fce2880
Repository: cloudstack
Updated Branches:
refs/heads/master c76302cdd -> fce2880b9
CLOUDSTACK-2694: Able to configure duplicate firewall rule with protocol and no ports
Signed-off-by: Jayapal <ja...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fce2880b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fce2880b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fce2880b
Branch: refs/heads/master
Commit: fce2880b9f20a372dd0a005c4575ffab526bac0b
Parents: c76302c
Author: namita.chaudhari <na...@sungard.com>
Authored: Tue Aug 5 09:16:29 2014 +0000
Committer: Jayapal <ja...@apache.org>
Committed: Tue Aug 5 17:57:54 2014 +0530
----------------------------------------------------------------------
server/src/com/cloud/network/firewall/FirewallManagerImpl.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fce2880b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java
index dd928d8..50ac9d1 100644
--- a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java
+++ b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java
@@ -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 &&