[Python-Dev] IPv6 bug in 2.3.4??

"Martin v. Löwis" martin at v.loewis.de
Wed Oct 27 19:53:26 CEST 2004


David G Mills wrote:
> I've noticed a potential bug and wanted to see if anyone else can 
> replicate it, or has also seen it. When creating a socket with 
> getaddrinfo, with the address family set to AF_UNSPEC and the host set to 
> localhost, the socket binds to IPv4 instead of IPv6. When using the FQD of 
> the machine it binds to IPv6. I've tested the same code on two different 
> machines, and the one running python 2.3.3 works as it should, but the 
> python 2.3.4 doesn't.

Can you show the code fragment that you use? socket.getaddrinfo does
never ever create sockets; only socket.socket does. So you apparently
somehow use the results of getaddrinfo to create the socket. As
getaddrinfo may return multiple results, you somehow need to select
one of the results to create the socket, but you don't explain which
result you use. A code snippet would answer the question.

> Anyone seen this? Can you replicate the error? Any help would be 
> appreciated. Oh yeah, I'm running on FC2 on the 2.3.4 machine and redhat 
> 8 on the 2.3.3 machine.

I can imagine a code fragment where this happens, but I hardly can
see an error here.

Regards,
Martin


More information about the Python-Dev mailing list