cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [43/50] git commit: updated refs/heads/4.4 to d5220a8
Date Mon, 28 Jul 2014 14:04:55 GMT
Polish IPv6 input error information

(cherry picked from commit 09abcf354f395b8d701c8b84b5ed20807f41519a)


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

Branch: refs/heads/4.4
Commit: bb5ba26b60977630a6015e88b4aab2c1d269d0be
Parents: ab85d00
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Tue Jul 1 15:16:40 2014 -0700
Committer: Daan Hoogland <daan@onecht.net>
Committed: Mon Jul 28 16:02:50 2014 +0200

----------------------------------------------------------------------
 utils/src/com/cloud/utils/net/NetUtils.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bb5ba26b/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 efb5ae5..aab1437 100755
--- a/utils/src/com/cloud/utils/net/NetUtils.java
+++ b/utils/src/com/cloud/utils/net/NetUtils.java
@@ -1381,11 +1381,19 @@ public class NetUtils {
     }
 
     public static String standardizeIp6Address(String ip6Addr) {
-        return IPv6Address.fromString(ip6Addr).toString();
+        try {
+            return IPv6Address.fromString(ip6Addr).toString();
+        } catch (IllegalArgumentException ex) {
+            throw new IllegalArgumentException("Invalid IPv6 address: " + ex.getMessage());
+        }
     }
 
     public static String standardizeIp6Cidr(String ip6Cidr){
-        return IPv6Network.fromString(ip6Cidr).toString();
+        try {
+            return IPv6Network.fromString(ip6Cidr).toString();
+        } catch (IllegalArgumentException ex) {
+            throw new IllegalArgumentException("Invalid IPv6 CIDR: " + ex.getMessage());
+        }
     }
 
     static final String VLAN_PREFIX = "vlan://";


Mime
View raw message