Skip to content

Commit 4adc974

Browse files
author
Sheng Yang
committed
IPv6: Disable untested features
1 parent ed547d9 commit 4adc974

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ public long getEntityOwnerId() {
268268
@Override
269269
// an exception thrown by createNetwork() will be caught by the dispatcher.
270270
public void execute() throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException{
271+
if (getStartIpv6() != null && getStartIp() != null) {
272+
throw new InvalidParameterValueException("Cannot support dualstack at this moment!");
273+
}
274+
271275
Network result = _networkService.createGuestNetwork(this);
272276
if (result != null) {
273277
NetworkResponse response = _responseGenerator.createNetworkResponse(result);

api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ private Map<Long, IpAddresses> getIpToNetworkMap() {
302302
if (requestedIpv6 != null) {
303303
requestedIpv6 = requestedIpv6.toLowerCase();
304304
}
305+
if (requestedIpv6 != null) {
306+
throw new InvalidParameterValueException("Cannot support specified IPv6 address!");
307+
}
305308
IpAddresses addrs = new IpAddresses(requestedIp, requestedIpv6);
306309
ipToNetworkMap.put(networkId, addrs);
307310
}
@@ -404,6 +407,10 @@ public void execute(){
404407
@Override
405408
public void create() throws ResourceAllocationException{
406409
try {
410+
if (getIp6Address() != null) {
411+
throw new InvalidParameterValueException("Cannot support specified IPv6 address!");
412+
}
413+
407414
//Verify that all objects exist before passing them to the service
408415
Account owner = _accountService.getActiveAccountById(getEntityOwnerId());
409416

server/src/com/cloud/network/NetworkServiceImpl.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,10 +735,6 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapac
735735

736736
UserContext.current().setAccountId(owner.getAccountId());
737737

738-
if (startIPv6 != null && startIP != null) {
739-
throw new InvalidParameterValueException("Cannot support dualstack at this moment!");
740-
}
741-
742738
boolean ipv4 = false, ipv6 = false;
743739
if (startIP != null) {
744740
ipv4 = true;

0 commit comments

Comments
 (0)