Bug 12714 - getaddrinfo(AF_INET6) does not return scope_id info provided by NSS modules
Summary: getaddrinfo(AF_INET6) does not return scope_id info provided by NSS modules
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.13
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-28 19:57 UTC by Maciej Babinski
Modified: 2019-01-15 12:04 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
Patch to resolve the issue. (785 bytes, patch)
2011-04-28 19:58 UTC, Maciej Babinski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Babinski 2011-04-28 19:57:32 UTC
It looks like this is a problem caused by overeager optimization: gaih_inet() falls back to using the faster _nss_*_gethostbyname2_r when the address family is specified explicitly. This function is incapable of returning scope_id info, so _gethostbyname4_r should be used whenever the NSS module implements it, and there is a possibility that an AF_INET6 address needs to be returned.

Patch attached.
Comment 1 Maciej Babinski 2011-04-28 19:58:55 UTC
Created attachment 5694 [details]
Patch to resolve the issue.
Comment 2 Ulrich Drepper 2011-05-03 01:11:59 UTC
I applied the patch with one more change.