Groguard / PocketChat-IRC-Client

IRC chat client made for PocketChip
17 stars 4 forks source link

No IPv6 Support #1

Open interfect opened 7 years ago

interfect commented 7 years ago

This app uses a default-constructed socket for its communications. The default socket constructor looks like this:

socket.socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)

That makes an AF_INET socket which can only connect to IPv4 hosts.

The app should use an AV_INET6 socket with the IPV6_V6ONLY flag set to 0, so that the socket can connect to both IPv6 and IPv4 hosts (by passing around the IPv4 addresses as IPv4-mapped IPv6 addresses.

I'm not quite sure what happens when you just throw a hostname at the Python socket connect in such a situation, and whether it is smart about resolving hosts with both IPv4 and IPv6 addresses available. You might need to call getaddrinfo yourself with AI_V4MAPPED in order to get IPv4-mapped addresses from a hostname.

Groguard commented 7 years ago

Hey, I'll have to take a look into this. I've never used IPv6 so, I'll have to do a little reading and test some things out.