Author kyuupichan
Recipients asvetlov, kyuupichan, yselivanov
Date 2018-11-23.18:30:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1542997853.2.0.788709270274.issue35302@psf.upfronthosting.co.za>
In-reply-to
Content
I run a machine with IPv4 and IPv6 interfaces on MacOSX Mojave.

I try to loop.create_connection() to a remote machine whose domain resolves to an IPv6 address only, with a local_addr domain name argument that resolves to two local addresses: an IPv4 one first and an IPv6 one second.

The loop https://github.com/python/cpython/blob/master/Lib/asyncio/base_events.py#L927-L943 that loops through the local addresses, IPv4 then IPv6, successfully binds the IPv4 laddr_info to the IPv6 socket successfully (something I find surprising) and then the connection attempt fails with OSError(65, 'No route to host'), at which point the sockets is closed and the IPv6 laddr_info is never tried and the connection attempt fails.

If I reverse the order of the loop so that the IPv6 laddr_info is tried first then the connection succeeds.

I suggest either all laddr_info bindings should be tried for each outer loop of infos, rather than just 1, or that those of a different socket "type" (IPv4 vs IPv6) should be skipped in the inner loop before attempting a binding.
History
Date User Action Args
2018-11-23 18:30:53kyuupichansetrecipients: + kyuupichan, asvetlov, yselivanov
2018-11-23 18:30:53kyuupichansetmessageid: <1542997853.2.0.788709270274.issue35302@psf.upfronthosting.co.za>
2018-11-23 18:30:53kyuupichanlinkissue35302 messages
2018-11-23 18:30:53kyuupichancreate