incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject [27/43] git commit: refs/heads/javelin - IPv6: Check startipv6, endipv6 and ip6Gateway with ip range
Date Fri, 01 Feb 2013 01:29:16 GMT
IPv6: Check startipv6, endipv6 and ip6Gateway with ip range


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

Branch: refs/heads/javelin
Commit: ed777bb7f33c653424e4169b7bde54ef272c4783
Parents: f57cbaa
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Wed Jan 30 22:13:46 2013 -0800
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Wed Jan 30 22:13:46 2013 -0800

----------------------------------------------------------------------
 .../src/com/cloud/network/NetworkServiceImpl.java  |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed777bb7/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index a5fd0e9..4467727 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -796,6 +796,15 @@ public class NetworkServiceImpl implements  NetworkService, Manager {
         	if (!NetUtils.isValidIp6Cidr(ip6Cidr)) {
         		throw new InvalidParameterValueException("Invalid ip6cidr");
         	}
+        	if (!NetUtils.isIp6InRange(startIPv6, ip6Cidr)) {
+        		throw new InvalidParameterValueException("startIPv6 is not in ip6cidr indicated
network range!");
+        	}
+        	if (!NetUtils.isIp6InRange(endIPv6, ip6Cidr)) {
+        		throw new InvalidParameterValueException("endIPv6 is not in ip6cidr indicated network
range!");
+        	}
+        	if (!NetUtils.isIp6InRange(ip6Gateway, ip6Cidr)) {
+        		throw new InvalidParameterValueException("ip6Gateway is not in ip6cidr indicated
network range!");
+        	}
         	
         	int cidrSize = NetUtils.getIp6CidrSize(ip6Cidr);
         	// Ipv6 cidr limit should be at least /64


Mime
View raw message