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

Reverse IP Range returns unexpected IPNetwork #187

Open
skandaloptagon opened this issue Oct 7, 2019 · 0 comments
Open

Reverse IP Range returns unexpected IPNetwork #187

skandaloptagon opened this issue Oct 7, 2019 · 0 comments

Comments

@skandaloptagon
Copy link

In version 0.7.19:

I would expect this to raise an exception when trying to calculate a range from a higher IP to a lower IP. Instead it returns an unexpected network.

>>> ip1 = "192.168.0.1"
>>> ip10 = "192.168.0.10"
>>> ip1 = IPSet(ip1)
[IPNetwork('192.168.0.1/32'), IPNetwork('192.168.0.2/31'), IPNetwork('192.168.0.4/30'), IPNetwork('192.168.0.8/31'), IPNetwork('192.168.0.10/32')]
>>> iprange_to_cidrs(ip10,ip1)
[IPNetwork('192.168.0.10/31')]

This appears to interpret my input as starting at 192.168.0.10 and ending at 192.168.0.11. I Suspect this is a bug and should raise an exception.

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

No branches or pull requests

1 participant