Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AD2C8109CF for ; Thu, 6 Feb 2014 12:47:40 +0000 (UTC) Received: (qmail 20966 invoked by uid 500); 6 Feb 2014 12:47:40 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 20752 invoked by uid 500); 6 Feb 2014 12:47:39 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 20740 invoked by uid 99); 6 Feb 2014 12:47:38 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Feb 2014 12:47:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2EEFA91DB33; Thu, 6 Feb 2014 12:47:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jayapal@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.3-forward to 7a71cf3 Date: Thu, 6 Feb 2014 12:47:38 +0000 (UTC) Updated Branches: refs/heads/4.3-forward bba6b7717 -> 7a71cf33c CLOUDSTACK-6040: Updated the ip addr validation in create port forwarding Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7a71cf33 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7a71cf33 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7a71cf33 Branch: refs/heads/4.3-forward Commit: 7a71cf33ce103392914ac51cd4689a6f5a340d0a Parents: bba6b77 Author: Jayapal Authored: Thu Feb 6 17:58:26 2014 +0530 Committer: Jayapal Committed: Thu Feb 6 18:04:20 2014 +0530 ---------------------------------------------------------------------- .../api/command/user/firewall/CreatePortForwardingRuleCmd.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a71cf33/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java index ff63d08..2e8f662 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java @@ -18,6 +18,7 @@ package org.apache.cloudstack.api.command.user.firewall; import java.util.List; +import com.cloud.utils.net.NetUtils; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -317,7 +318,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P Ip privateIp = getVmSecondaryIp(); if (privateIp != null) { - if ( !privateIp.isIp4()) { + if (!NetUtils.isValidIp(privateIp.toString())) { throw new InvalidParameterValueException("Invalid vm ip address"); } }