An odd IPv6 application issue
gbonser at seven.com
Tue Dec 14 03:33:27 CET 2010
Let me try to explain this more completely:
Lets say I have in /etc/hosts:
Now I start an application that opens connections to various places around the Internet. I tell it to use foo-a.example.com as the source of the socket binding. I also have another instance of the same application bound to foo-b.example.com
This application engages in transactions with external hosts. I have no idea beforehand if I am going to get an ipv4 or an ipv6 address for the remote host. When it comes time to perform one of these transactions, I tell it to connect to the remote IP/port using foo-x as the local end.
So the local end resolves to both an IPv4 and an IPv6 address.
When the remote end resolves to an IPv6 address, the local machine will open an IPv6 socket and send to the remote host but the source address it uses is ::ffff:10.1.1.1 instead of 2620:0:510f:1234::1 and that is the bug.
Mind you if I explicitly tell it to bind to the v6 address or the v4 address it works as expected when talking to a remote host of that protocol. If the local end has only a v6 address, it sources traffic from that v6 address. But I don't know in advance which protocol I am going to need. The application needs to be configured with one source "name" to use for either protocol. Using that v6 mapped v4 address is just not going to work across the Internet.
More information about the ipv6-ops