DaanHoogland commented on a change in pull request #3635: server: acquire IPv4 
address when add secondary IP to nic if IP is not specified
URL: https://github.com/apache/cloudstack/pull/3635#discussion_r346391870
 
 

 ##########
 File path: server/src/main/java/com/cloud/network/NetworkServiceImpl.java
 ##########
 @@ -732,11 +732,10 @@ public NicSecondaryIp allocateSecondaryGuestIP(final 
long nicId, IpAddresses req
             }
 
             try {
-                if (ipv4Address != null) {
-                    ipaddr = _ipAddrMgr.allocatePublicIpForGuestNic(network, 
podId, ipOwner, ipv4Address);
-                }
                 if (ipv6Address != null) {
                     ip6addr = 
ipv6AddrMgr.allocatePublicIp6ForGuestNic(network, podId, ipOwner, ipv6Address);
+                } else {
 
 Review comment:
   I'm a bit confused, the null check for ipv4address is gone and it is not 
assigned (even when not null) when it isn't but ipv6Address is not null. This 
means that if both are available ipv6 is the *only one* used. Is that what you 
intend @ustcweizhou ?
   I see how this fixes backwards compatibility btw, just wondering if we would 
want to allow dualstack!?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to