Bug 621229 - Cumin binds inet6 address only
Summary: Cumin binds inet6 address only
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: cumin
Version: Development
Hardware: All
OS: Linux
Target Milestone: 1.3
: ---
Assignee: messaging-bugs
QA Contact: Jan Sarenik
Depends On:
TreeView+ depends on / blocked
Reported: 2010-08-04 14:56 UTC by Jan Sarenik
Modified: 2010-09-08 12:06 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2010-09-08 12:06:40 UTC

Attachments (Terms of Use)

Description Jan Sarenik 2010-08-04 14:56:18 UTC
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 15:02:01 UTC
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 12:06:40 UTC
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.