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

is_loopback behaviour differs between ipv4 and ipv6 for IPNetwork #222

Closed
nkeulen opened this issue Jan 27, 2021 · 3 comments
Closed

is_loopback behaviour differs between ipv4 and ipv6 for IPNetwork #222

nkeulen opened this issue Jan 27, 2021 · 3 comments

Comments

@nkeulen
Copy link
Contributor

nkeulen commented Jan 27, 2021

IPv4 behaviour:

>>> netaddr.IPAddress('127.0.0.1').is_loopback()
True
>>> netaddr.IPNetwork('127.0.0.1/32').is_loopback()
True

IPv6:

>>> netaddr.IPAddress('::1').is_loopback()
True
>>> netaddr.IPNetwork('::1/128').is_loopback()
False

I would expect all of the examples above to return True.
But as you can see netaddr.IPNetwork('::1/128').is_loopback() doesn't.

Tested on: 0.8.0

nkeulen pushed a commit to nkeulen/netaddr that referenced this issue Jan 27, 2021
@nkeulen
Copy link
Contributor Author

nkeulen commented Jan 27, 2021

Fixed this in my local version and created a pull request: #223
If you agree with the fix please merge it :)

@nkeulen
Copy link
Contributor Author

nkeulen commented Jan 28, 2021

Was fixed with merge of #223

@nkeulen nkeulen closed this as completed Jan 28, 2021
@jstasiak
Copy link
Contributor

Released in version 0.9.0 today.

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

2 participants