Skip to content

Conversation

@Ramzeth
Copy link

@Ramzeth Ramzeth commented Oct 26, 2021

I've added "CoveringNetworks" search feature. It's like ContainingNetworks() for but for IPnet instead of single IP.

Comment on lines +130 to +131
net := rnet.NewNetwork(network)
return p.coveringNetworks(net)
Copy link
Owner

@yl2chen yl2chen Oct 29, 2021

Choose a reason for hiding this comment

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

Thanks for the PR! btw is new implementation needed, could we not just do the following?

Suggested change
net := rnet.NewNetwork(network)
return p.coveringNetworks(net)
return p.ContainingNetworks(network.IP.Mask(network.IPMask))

Copy link
Author

Choose a reason for hiding this comment

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

I thought about this method. But i've discover Covers function, and decided to use it.

monoidic added a commit to monoidic/cidranger that referenced this pull request Aug 28, 2022
@hiddn hiddn mentioned this pull request Jan 6, 2023
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