tehmaze/ipcalc

Subnet in subnet

gczuczy opened this issue · 0 comments

Hello,

Using python2.6 (centos6) I've found the following:

$ python
Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipcalc
>>> subnet = ipcalc.Network('128.121.0.0/16')
>>> rentry = ipcalc.Network('128.121.159.48/28')
>>> subnet in rentry
True
>>> rentry in subnet
True

And it's ipcalc version 1.1.3

Are you exactly sure that the above expression should return true in both direction? Personally I think a /16 should have difficulties in being a subset of a /28. It's very hard to create a /28 superset which covers a /16.