This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug network/12377] getaddrinfo() should disregard link-local IPv6 addresses for AI_ADDRCONFIG purposes


http://sourceware.org/bugzilla/show_bug.cgi?id=12377

Pavel Åimerda <psimerda at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |psimerda at redhat dot com

--- Comment #9 from Pavel Åimerda <psimerda at redhat dot com> 2012-07-27 13:53:27 UTC ---
> The %ifname convention has nothing to do with getaddrinfo(), it's interpreted
> by the application.

This is incorrect. I'm using %-addresses daily with OpenSSH and it passes the
whole address to getaddrinfo()

That's why there is scope_id in struct sockaddr_in6.

  struct sockaddr_in6 {
    sa_family_t     sin6_family;   /* AF_INET6 */
    in_port_t       sin6_port;     /* port number */
    uint32_t        sin6_flowinfo; /* IPv6 flow information */
    struct in6_addr sin6_addr;     /* IPv6 address */
    uint32_t        sin6_scope_id; /* Scope ID (new in 2.4) */
  };

Interface name behind % must be translated to the scope_id.

> When passing it to getaddrinfo() you'll get this result:
> 
> tore@wrath:~$ ./gai-test "sourceware.org%eth0"
> [         0us] begin gai_and_connect(sourceware.org%eth0)
> [+    99007us] getaddrinfo(sourceware.org%eth0) failed: Name or service not
> known

This is a bug and it's caused exactly by the patch from this bugreport and by
making AI_ADDRCONFIG default in getaddrinfo.

It breaks IPv6 node-local and link-local networking:

https://bugzilla.redhat.com/show_bug.cgi?id=808147

It breaks IPv4 node-local networking too (and probably also link-local if
anybody uses that):

https://bugzilla.redhat.com/show_bug.cgi?id=721350

You can't just kill localhost and link-local networking as if nothing happens.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]