You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by we...@apache.org on 2015/03/16 12:58:28 UTC

[2/2] git commit: updated refs/heads/4.5 to 75da050

CLOUDSTACK-8329: CloudStack accepts IP ends with dot


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/75da0506
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/75da0506
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/75da0506

Branch: refs/heads/4.5
Commit: 75da05068a2d283460911cb755fcfccabd84f71e
Parents: 5a860fe
Author: Wei Zhou <w....@tech.leaseweb.com>
Authored: Mon Mar 16 12:58:07 2015 +0100
Committer: Wei Zhou <w....@tech.leaseweb.com>
Committed: Mon Mar 16 12:58:07 2015 +0100

----------------------------------------------------------------------
 utils/src/com/cloud/utils/net/NetUtils.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/75da0506/utils/src/com/cloud/utils/net/NetUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/net/NetUtils.java b/utils/src/com/cloud/utils/net/NetUtils.java
index 0eda3f8..f798d25 100755
--- a/utils/src/com/cloud/utils/net/NetUtils.java
+++ b/utils/src/com/cloud/utils/net/NetUtils.java
@@ -515,6 +515,10 @@ public class NetUtils {
     }
 
     public static boolean isValidIp(final String ip) {
+        if (ip.endsWith(".")) {
+            return false;
+        }
+
         final String[] ipAsList = ip.split("\\.");
 
         // The IP address must have four octets