DaanHoogland commented on code in PR #7153:
URL: https://github.com/apache/cloudstack/pull/7153#discussion_r1115387048


##########
server/src/main/java/com/cloud/network/IpAddressManagerImpl.java:
##########
@@ -1476,7 +1476,8 @@ public IPAddressVO associateIPToGuestNetwork(long ipId, 
long networkId, boolean
         //     - if shared network in Advanced zone
         //     - and it belongs to the system
         if (network.getAccountId() != owner.getId()) {
-            if (zone.getNetworkType() != NetworkType.Basic && 
!(zone.getNetworkType() == NetworkType.Advanced && network.getGuestType() == 
Network.GuestType.Shared)) {
+            if (zone.getNetworkType() != NetworkType.Basic &&
+                    !(zone.getNetworkType() == NetworkType.Advanced && 
network.getGuestType() == Network.GuestType.Shared || network.getVpcId() == 
ipToAssoc.getVpcId()))  {

Review Comment:
   please look at the bug sonar reported, I think this one is serious.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to