This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.13
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


View the commit online:
https://github.com/apache/cloudstack/commit/d981edb4bcd84e387ad8986f5792245892900f40

The following commit(s) were added to refs/heads/4.13 by this push:
     new d981edb  server: acquire IPv4 address when add secondary IP to nic if 
IP is not specified (#3635)
d981edb is described below

commit d981edb4bcd84e387ad8986f5792245892900f40
Author: Wei Zhou <[email protected]>
AuthorDate: Thu Nov 21 07:14:41 2019 +0100

    server: acquire IPv4 address when add secondary IP to nic if IP is not 
specified (#3635)
    
    After commit fbf488497fb863c13fc0908281e3f4f86906df43, admin need to 
specify an ipv4 or ipv6 addresses when add IP to nic which breaks backward 
compatibity. If IP is not specified, a IPv4 address should be returned.
---
 server/src/main/java/com/cloud/network/NetworkServiceImpl.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java 
b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
index 3359b27..f440ced 100644
--- a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
@@ -732,11 +732,10 @@ public class NetworkServiceImpl extends ManagerBase 
implements NetworkService {
             }
 
             try {
-                if (ipv4Address != null) {
-                    ipaddr = _ipAddrMgr.allocatePublicIpForGuestNic(network, 
podId, ipOwner, ipv4Address);
-                }
                 if (ipv6Address != null) {
                     ip6addr = 
ipv6AddrMgr.allocatePublicIp6ForGuestNic(network, podId, ipOwner, ipv6Address);
+                } else {
+                    ipaddr = _ipAddrMgr.allocatePublicIpForGuestNic(network, 
podId, ipOwner, ipv4Address);
                 }
                 if (ipaddr == null && ipv6Address == null) {
                     throw new InvalidParameterValueException("Allocating ip to 
guest nic " + nicId + " failed");

Reply via email to