-
Notifications
You must be signed in to change notification settings - Fork 1.3k
server: fix the subnet overlap checking logic for tagged and untagged vlans when adding ipranges #3430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server: fix the subnet overlap checking logic for tagged and untagged vlans when adding ipranges #3430
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -209,7 +209,6 @@ | |
| import com.cloud.utils.NumbersUtil; | ||
| import com.cloud.utils.Pair; | ||
| import com.cloud.utils.StringUtils; | ||
| import com.cloud.utils.UriUtils; | ||
| import com.cloud.utils.component.ManagerBase; | ||
| import com.cloud.utils.db.DB; | ||
| import com.cloud.utils.db.EntityManager; | ||
|
|
@@ -3542,9 +3541,7 @@ public Vlan createVlanAndPublicIpRange(final long zoneId, final long networkId, | |
| continue; | ||
| } | ||
| // from here, subnet overlaps | ||
| if (!UriUtils.checkVlanUriOverlap( | ||
| BroadcastDomainType.getValue(BroadcastDomainType.fromString(vlanId)), | ||
| BroadcastDomainType.getValue(BroadcastDomainType.fromString(vlan.getVlanTag())))) { | ||
| if (!vlanId.equals(vlan.getVlanTag())) { | ||
| boolean overlapped = false; | ||
| if( network.getTrafficType() == TrafficType.Public ) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code formatting for this section of code is different ( spaces used )
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean |
||
| overlapped = true; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may cause an issue, because the vlan.getVlanTag() could be something like a range 100-200, so if vlanId is 101 the check should be done in the range. Let me revisit this shortly and check if the overlap check is necessary or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or perhaps if the issue is just for the 'untagged' VLAN, a specific check/condition could be added. This is because sometimes people add address ranges belonging to a VLAN (say vlan://101) instead of vlan://untagged (or untagged)