Skip to content

Make containscidr private #3080

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

Merged
merged 1 commit into from
Aug 9, 2025
Merged

Conversation

fujita
Copy link
Member

@fujita fujita commented Aug 7, 2025

No description provided.

@@ -619,6 +620,13 @@ func (t *Table) GetKnownPathListWithMac(id string, as uint32, rt bgp.ExtendedCom
return paths
}

// ContainsCIDR checks if one IPNet is a subnet of another.
func containsCIDR(n1, n2 *net.IPNet) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel the whole things (table/ipnet) need to be changed to use netip.Prefix.Contains()
let's merge this one add this to the todolist

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, we don't need to convert netip.Prefix to net.IPnet. The priority is removing the usage of net.IP* from public APIs. We can clean up the internal usages even after 4.0 release.

Move ContainsCIDR to table package and make it private.

Signed-off-by: FUJITA Tomonori <[email protected]>
@fujita fujita force-pushed the make-containscidr-private branch from a7f4239 to 23ddee2 Compare August 9, 2025 05:24
@fujita fujita merged commit 23ddee2 into osrg:master Aug 9, 2025
79 of 80 checks passed
@fujita fujita deleted the make-containscidr-private branch August 9, 2025 05:40
@fujita
Copy link
Member Author

fujita commented Aug 9, 2025

@nplanelcisco thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants