Issue 56 in netaddr: checking IPAddress in IPNetwork

2 views
Skip to first unread message

codesite...@google.com

unread,
Aug 25, 2010, 8:59:57 AM8/25/10
to net...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 56 by n6vale: checking IPAddress in IPNetwork
http://code.google.com/p/netaddr/issues/detail?id=56

What steps will reproduce the problem?
print IPAddress('192.168.1.1') in IPNetwork('192.168.1/24')

What is the expected output? What do you see instead?
Should return True, not False

What version of the product are you using? On what operating system?
netaddr 0.74 Ubuntu Linux 10.04

Please provide any additional information below.


codesite...@google.com

unread,
Aug 27, 2010, 3:19:17 AM8/27/10
to net...@googlegroups.com
Updates:
Status: Accepted
Labels: -Priority-Medium Priority-High

Comment #1 on issue 56 by drkjam: checking IPAddress in IPNetwork
http://code.google.com/p/netaddr/issues/detail?id=56

Yep, that's a bug. Will take a look at this for the next release.

=Additional Detail

The address portion of the IPNetwork address '192.168.1' should resolve
to '192.168.1.0', not 192.168.0.1 as it does presently.

codesite...@google.com

unread,
Sep 7, 2010, 5:45:42 AM9/7/10
to net...@googlegroups.com

Comment #2 on issue 56 by n6vale: checking IPAddress in IPNetwork
http://code.google.com/p/netaddr/issues/detail?id=56

Any idea when this might be fixed. I could really do with this ASAP. Or,
is there a work around I could use with the existing version?

Cheers

codesite...@google.com

unread,
Sep 7, 2010, 9:54:33 AM9/7/10
to net...@googlegroups.com

Comment #3 on issue 56 by drkjam: checking IPAddress in IPNetwork
http://code.google.com/p/netaddr/issues/detail?id=56

Yes, there is a workaround, just use the implicit_prefix argument, like
so :-

>>> IPAddress('192.168.1.1') in IPNetwork('192.168.1/24',
>>> implicit_prefix=True)
True

Or simply :-

>>> IPAddress('192.168.1.1') in IPNetwork('192.168.1/24', True)
True


Apologies for the delay. I've been looking for a spare moment to sit down
and work on a release. Should have the next full release out in the next
24-48 hours after I've conducted some proper testing. Thanks for your
patience.

Reply all
Reply to author
Forward
0 new messages