[New-bugs-announce] [issue27269] ipaddress: Wrong behavior with ::ffff:1.2.3.4 style IPs

ThiefMaster report at bugs.python.org
Wed Jun 8 10:55:23 EDT 2016


New submission from ThiefMaster:

I'd expect the IPv4 address to be considered part of that network (or actually parsed as an IPv4Address and not IPv6Address) even if it's written in IPv6 notation. It's an IPv4 after all.

Python 3.5.1 (default, Jun  7 2016, 09:20:44)
[GCC 4.9.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipaddress
>>> ipaddress.ip_address('::ffff:127.0.0.1')
IPv6Address('::ffff:7f00:1')
>>> ipaddress.ip_address('::ffff:127.0.0.1') in ipaddress.ip_network('127.0.0.0/8')
False
>>> ipaddress.ip_address('127.0.0.1') in ipaddress.ip_network('127.0.0.0/8')
True

----------
components: Library (Lib)
messages: 267861
nosy: ThiefMaster
priority: normal
severity: normal
status: open
title: ipaddress: Wrong behavior with ::ffff:1.2.3.4 style IPs
type: behavior
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27269>
_______________________________________


More information about the New-bugs-announce mailing list