Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,10 @@ public boolean equals(Object obj) {
return true;
}

return NetUtils.isNetworkAWithinNetworkB(cidr, that.cidr);
final String normalizedCidr = com.cloud.utils.StringUtils.getFirstValueFromCommaSeparatedString(cidr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes should be reverted, I think ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeanvetorello
are you available to work on this PR ?

final String normalizedThatCidr = com.cloud.utils.StringUtils.getFirstValueFromCommaSeparatedString(that.cidr);

return NetUtils.isNetworkAWithinNetworkB(normalizedCidr, normalizedThatCidr);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5425,7 +5425,7 @@ public Vlan createVlanAndPublicIpRange(final long zoneId, final long networkId,
final VlanVO vlan = commitVlanAndIpRange(zoneId, networkId, physicalNetworkId, podId, startIP, endIP, vlanGateway, vlanNetmask, vlanId, domain, vlanOwner, vlanIp6Gateway, vlanIp6Cidr,
ipv4, zone, vlanType, ipv6Range, ipRange, forSystemVms, provider);

if (vlan != null) {
if (vlan != null && network.getTrafficType() != TrafficType.Public) {
if (ipv4) {
addCidrAndGatewayForIpv4(networkId, vlanGateway, vlanNetmask);
} else if (ipv6) {
Expand Down Expand Up @@ -6504,11 +6504,14 @@ private boolean deleteAndPublishVlanAndPublicIpRange(final long userId, final lo
final boolean ipv4 = deletedVlan.getVlanGateway() != null;
final boolean ipv6 = deletedVlan.getIp6Gateway() != null;
final long networkId = deletedVlan.getNetworkId();
final NetworkVO networkVO = _networkDao.findById(networkId);

if (ipv4) {
removeCidrAndGatewayForIpv4(networkId, deletedVlan);
} else if (ipv6) {
removeCidrAndGatewayForIpv6(networkId, deletedVlan);
if (networkVO != null && networkVO.getTrafficType() != TrafficType.Public) {
if (ipv4) {
removeCidrAndGatewayForIpv4(networkId, deletedVlan);
} else if (ipv6) {
removeCidrAndGatewayForIpv6(networkId, deletedVlan);
}
}

messageBus.publish(_name, MESSAGE_DELETE_VLAN_IP_RANGE_EVENT, PublishScope.LOCAL, deletedVlan);
Expand Down
Loading