Red Hat Bugzilla – Bug 621229
Cumin binds inet6 address only
Last modified: 2010-09-08 08:06:40 EDT
Description of problem:
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Excuse me, I pressed ENTER too early...
The problem is that if hostname resolves to both ipv6 and ipv4 address,
cumin will bind only to ipv6.
10.34.32.136 ooo.englab.brq.redhat.com ooo
2620:52:0:2223:21a:a0ff:feac:f08f ooo.englab.brq.redhat.com ooo
# log-file: $CUMIN_HOME/log/web.log
When I delete the line containing IPv6 address from /etc/hosts (and
there is no AAAA record for it in DNS), it binds to IPv4 address.
I would expect it to bind to all addresses which the hostname resolves
This is a python behavior, not a cumin one. (And maybe not even just a python behavior.)
From http://docs.python.org/library/socket.html :
"If you use a hostname in the host portion of IPv4/v6 socket address, the program may show a nondeterministic behavior, as Python uses the first address returned from the DNS resolution. The socket address will be resolved differently into an actual IPv4/v6 address, depending on the results from DNS resolution and/or the host configuration. For deterministic behavior use a numeric address in host portion."
I suspect that linux for whatever reason is returning the ip6 address first, and as you point out, python sockets only bind to one address.