What is not addressed by this patch is that twisted assumes that if it is given 
a hostname, then the user clearly means IPv4.  The web client setup is not in 
the correct order, it should be:
1) resolve the hostname
2) iterate through the available IP addresses (probably preferring ipv6, like 
the rest of linux), trying each one until success, or end-of-list
2a) create the AF_INET/AF_INET6 socket based on the address family of the 
current trial IP.
2b) connect.

Today, it creates the socket based on the name it's given (ipv4 address,
ipv6 address, or "huh... hostname, let's try ipv4") and then resolves
it.

The other option would be to create an AF_INET6 socket, and if it turns
out that it's an IPv4 address, change it to the compatible ipv6 address
of "::ffff:192.168.1.1" or such.  Note that if the app then calls
getsockname() on the socket, it will see the ipv6-form, and may be
confused.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1604608

Title:
  ipv6 client causes errors in twisted.web

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/twisted/+bug/1604608/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to