phihag / ipaddress

Python 3.3+'s ipaddress for older Python versions
Other
105 stars 53 forks source link

packed fails for IPv6 address #61

Open hesingh opened 3 years ago

hesingh commented 3 years ago

The IPv6 address is 2002::1. So why does packednot include the inner "2" in the IPv6 address?

>>> 
>>> ip = ipaddress.ip_address('2002::1')
>>> ip
IPv6Address('2002::1')
>>> ip.packed
b' \x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
>>>