Bug 621229 - Cumin binds inet6 address only
Cumin binds inet6 address only
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: cumin (Show other bugs)
All Linux
medium Severity medium
: 1.3
: ---
Assigned To: messaging-bugs
Jan Sarenik
Depends On:
  Show dependency treegraph
Reported: 2010-08-04 10:56 EDT by Jan Sarenik
Modified: 2010-09-08 08:06 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-09-08 08:06:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Sarenik 2010-08-04 10:56:18 EDT
Description of problem:

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:
Comment 1 Jan Sarenik 2010-08-04 11:02:01 EDT
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.


/etc/hosts contents:     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
host: ooo
port: 45672

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
Comment 2 Justin Ross 2010-09-08 08:06:40 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.