[Python-bugs-list] [ python-Bugs-618594 ] Connecting to IPv4 addrs from IPv6 socke

noreply@sourceforge.net noreply@sourceforge.net
Sat, 05 Oct 2002 03:11:12 -0700


Bugs item #618594, was opened at 2002-10-04 17:08
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=618594&group_id=5470

Category: Extension Modules
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Jesús Cea Avión (jcea)
Assigned to: Nobody/Anonymous (nobody)
Summary: Connecting to IPv4 addrs from IPv6 socke

Initial Comment:
You can connect to a IPv4 addr "a.b.c.d" from a IPv6
socket simply connecting to "::FFFF:a.b.c.d" IPv6 address.

When you issue a "connect" call on a IPv6 socket using
a pure IPv4 addr "a.b.c.d", this format SHOULD be
converted "automagically" to "::FFFF:a.b.c.d",
intenally. Currently, this operation gives an error.

The real problem is "connect" call using a hostname
(not resolved to a IPv4 or IPv6 addr). Since I don't
know to which IP address type the host will resolve, I
think the correct course should be to promote IPv4 to
IPv6 address space (if the socket is IPv6) and to
connect normally.

Obviously, trying to connect to a IPv6 addr using a
IPv4 socket should fail, like just now.

When a hostname used in "connect" call resolves to both
IPv4 and IPv6 addresses, it would use IPv4 if the
socket is IPv4, and IPv6 if the socket is IPv6.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-10-05 12:11

Message:
Logged In: YES 
user_id=21627

I fail to see a Python bug here. All calls are delegated to
the C library, which delegates most of it to the kernel. So
complain to your operating system vendor.

I don't think your complaint is valid, though: the sockaddr
is computed by looking at its format. If it does not
contains a colon, it is not an AF_INET6.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=618594&group_id=5470