Bug 1118723
Summary: | RFE: NSS module entry points for gethostbyname() that take an address family, and can return a scopeid | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Lennart Poettering <lpoetter> |
Component: | glibc | Assignee: | Carlos O'Donell <codonell> |
Status: | CLOSED DUPLICATE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | codonell, fweimer, grawity, jakub, law, mnewsome, pfrankli |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-02-04 16:02:22 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Lennart Poettering
2014-07-11 11:11:15 UTC
Lennart, Thanks for the bug. Could you please provide a small test case for us so we have something concerte to use when we look at implementing this? It sound slike you already have a system semi-configured like this, and it would be nice if we could just crib your config notes. A good test case for this is nss-myhostname, as shipped with current systemd. The modules' purpose is to resolve the localhost name to all local addresses, including link local ones, with appropriate ifindex. With this module enabled in /etc/nsswitch.conf, I get this behaviour: lennart@delta $ telnet delta Trying fe80::2ed0:5aff:fe32:d0ea%wlp0s26u1u4i2... telnet: connect to address fe80::2ed0:5aff:fe32:d0ea%wlp0s26u1u4i2: Connection refused Trying 172.31.0.125... telnet: connect to address 172.31.0.125: Connection refused Here, "delta" is my own hostname. We see that it finds the IPv6 address of the local host, with the correct ifindex. That's because telnet does not specify a protocol when resolving the name, and hence the NSS module's gethostbyname4_r() is called, which can return the ifindex just fine. All is good. (of course the connection fails, because i have no telnet server running, but that's besides the point). lennart@delta $ ping6 delta connect: Invalid argument This fails though, since ping6 actually specifies a protocol family when resolving the name (AF_INET6, of course), which means the NSS modules' gethostbyname3_r() is called instead, which cannot return the ifindex. ping6 tries to connect to the returned link-local Ipv6 address, which lacks an ifindex, which the kernel then refuses on connect() with EINVAL... The current sources of nss-myhostname you find here: http://cgit.freedesktop.org/systemd/systemd/plain/src/nss-myhostname/nss-myhostname.c (note that the version of this currently available in fedora is considerably different, but exposes the same behaviour here, so you can use that to test...) *** This bug has been marked as a duplicate of bug 843054 *** |