mirror of https://github.com/apache/cloudstack.git
server: acquire IPv4 address when add secondary IP to nic if IP is not specified (#3635)
After commit fbf488497f, 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.
This commit is contained in:
parent
23ca806db9
commit
d981edb4bc
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue