rafaelweingartner commented on a change in pull request #2773:
CLOUDSTACK-10328: Add Secondary IPv6 address through API
URL: https://github.com/apache/cloudstack/pull/2773#discussion_r205417670
##########
File path:
api/src/main/java/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java
##########
@@ -169,17 +161,25 @@ public long getEntityOwnerId() {
@Override
public void create() throws ResourceAllocationException {
- String ip;
NicSecondaryIp result;
- String secondaryIp = null;
- if ((ip = getIpaddress()) != null) {
- if (!NetUtils.isValidIp4(ip)) {
- throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,
"Invalid ip address " + ip);
+ boolean isIpv4 = true;
+
+ if (ipAddr != null) {
+ if (!NetUtils.isValidIp4(ipAddr)) {
+ isIpv4 = false;
+ }
+ if (!NetUtils.isValidIp6(ipAddr) && !isIpv4) {
+ throw new InvalidParameterValueException("Invalid ip address "
+ ipAddr);
}
}
+ IpAddresses requestedIpPair = new IpAddresses(ipAddr, null);
Review comment:
Can I request to allocate an IPV4 and IPV6 at the same time?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services