Project

General

Profile

Actions

Bug #6489

closed

ceph-deploy: get_nonlocal_ip() should filter ipv6 addrs

Added by Dan Mick over 10 years ago. Updated over 9 years ago.

Status:
Can't reproduce
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

get_nonlocal_ip isn't prepared to see ipv6 addresses back from getaddrinfo(); although
I haven't reproduced it personally, a user reports that they appear like this:

(10, 1, 6, '', (10, b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')), (10, 2, 17, '', (10, b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')), (10, 3, 0, '', (10, b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'))

(note the first number in the tuple is family, and 10 is AF_INET6). The code assumes it
will be seeing IPv4 addrs, which look like

(2, 1, 6, '', ('127.0.0.1', 0))

and so it blindly looks for '127.' at the start of element40. This fails for v6 addrs.

Until we fully implement v6 support, it's probably best to just ignore list entries
with a family of AF_INET6.

Actions #1

Updated by Dan Mick over 10 years ago

However, if I add "::1 <hostname>" to my /etc/hosts, and issue getaddrinfo, I get
back v6 entries that look like:

(10, 1, 6, '', ('::1', 0, 0, 0)), (10, 2, 17, '', ('::1', 0, 0, 0)), (10, 3, 0, '', ('::1', 0, 0, 0))

so I don't know what's causing the alternate format response on the user's system.

getaddrinfo documents:

sockaddr is a tuple describing a socket address, whose format depends on the returned family (a (address, port) 2-tuple for AF_INET, a (address, port, flow info, scope id) 4-tuple for AF_INET6)

so it seems this user's return format is not as expected; I've no idea how or why.
I note this exists: https://groups.google.com/forum/#!topic/web2py/t_11PX-hYt0 so others have had similar problems on Gentoo.

Actions #2

Updated by Michael Jones over 10 years ago

I'm the user that orignally reported this issue, and after talking with the Gentoo crowd about the issue, we've discovered that this is a known bug in python when ipv6 is disabled.

You can read more here: http://bugs.python.org/issue16208

ceph-deploy can do one of many things (obviously, this is not an exaustive list, and I'm not in a position to tell the ceph-deploy team what to do, these are just suggestions...)

1) Consider this a failure condition in the environment and refuse to address the issue (perfectly valid response).
2) Work around this error by parsing the returned hexidecimal gibberish and handling it that way.
3) Warn the user that their python installation has IPv6 disabled and exit, or skip over ipv6 addresses.

Actions #3

Updated by Michael Jones over 10 years ago

To further elaborate, when I recompiled python so that IPv6 support was properly enabled, the problems that I was having with running ceph-deploy were no longer reproducable.

Actions #4

Updated by Alfredo Deza over 9 years ago

  • Status changed from New to Can't reproduce
Actions

Also available in: Atom PDF