You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ya...@apache.org on 2013/05/25 01:47:16 UTC
git commit: updated refs/heads/master to a1437ae
Updated Branches:
refs/heads/master d99fae07c -> a1437ae82
CLOUDSTACK-2563: Network ACL: Allow protocol 1(icmp) paired with icmp type/code
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a1437ae8
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a1437ae8
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a1437ae8
Branch: refs/heads/master
Commit: a1437ae82e9c686139c85ac9d3eb039bf968c014
Parents: d99fae0
Author: Sheng Yang <sh...@citrix.com>
Authored: Fri May 24 16:45:15 2013 -0700
Committer: Sheng Yang <sh...@citrix.com>
Committed: Fri May 24 16:46:44 2013 -0700
----------------------------------------------------------------------
.../command/user/network/CreateNetworkACLCmd.java | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a1437ae8/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
index 275fa18..3a56fe4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
@@ -31,6 +31,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NetworkACLItemResponse;
import org.apache.cloudstack.api.response.NetworkACLResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
+import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import com.cloud.async.AsyncJob;
@@ -98,7 +99,15 @@ public class CreateNetworkACLCmd extends BaseAsyncCreateCmd {
// ///////////////////////////////////////////////////
public String getProtocol() {
- return protocol.trim();
+ String p = protocol.trim();
+ // Deal with ICMP(protocol number 1) specially because it need to be paired with icmp type and code
+ if(StringUtils.isNumeric(p)){
+ int protoNumber = Integer.parseInt(p);
+ if (protoNumber == 1) {
+ p = "icmp";
+ }
+ }
+ return p;
}
public List<String> getSourceCidrList() {