Skip to content

Commit f76b6c6

Browse files
committed
Merge remote-tracking branch 'apache/4.17' into main
2 parents ad0ae83 + cd37b13 commit f76b6c6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,11 @@ private boolean releaseIpAddressInternal(long ipAddressId) throws InsufficientAd
10751075
if (networkId != null) {
10761076
guestNetwork = getNetwork(networkId);
10771077
}
1078-
if (ipVO.isSourceNat() && guestNetwork != null && guestNetwork.getState() != Network.State.Allocated) {
1078+
Vpc vpc = null;
1079+
if (ipVO.getVpcId() != null) {
1080+
vpc = _vpcMgr.getActiveVpc(ipVO.getVpcId());
1081+
}
1082+
if (ipVO.isSourceNat() && ((guestNetwork != null && guestNetwork.getState() != Network.State.Allocated) || vpc != null)) {
10791083
throw new IllegalArgumentException("ip address is used for source nat purposes and can not be disassociated.");
10801084
}
10811085

0 commit comments

Comments
 (0)