Skip to content
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

Merge adjacent address ranges #93

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kirill-v
Copy link
Contributor

Hi,
thank you for useful library!

When I create L3Rule using the List field of the IPAddrSpec I get error in case of sequential addresses like 1.2.3.32 and 1.2.3.33. I see that inside the library the list is represented like: [{"Key":"1.2.3.32","IntervalEnd":false,"Val":[]},{"Key":"1.2.3.33","IntervalEnd":true,"Val":[]},{"Key":"1.2.3.33","IntervalEnd":false,"Val":[]},{"Key":"1.3.3.34","IntervalEnd":true,"Val":[]}]]. The nft command shows that the corresponding set is not created. So I added code that merges adjacent intervals. But I don't know whether it is a proper solution though. The Range field in the IPAddrSpec structure could be used but it is less convenient.

@sbezverk
Copy link
Owner

@kirill-v Thank you for PR and sorry for the delay in reply. I will run some additional tests and get back to you.

It is required because of the
google/nftables#145
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