Skip to content

Commit

Permalink
* sysdeps/posix/getaddrinfo.c (get_scope): Loopback addresses have
Browse files Browse the repository at this point in the history
	to be treated like link-local addresses.
  • Loading branch information
Ulrich Drepper committed May 14, 2008
1 parent 1f03982 commit 5fab554
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2008-05-14 Ulrich Drepper <drepper@redhat.com>

* sysdeps/posix/getaddrinfo.c (get_scope): Loopback addresses have
to be treated like link-local addresses.

* sysdeps/posix/getaddrinfo.c (getaddrinfo): Add _res_hconf_init
if necessary.

Expand Down
5 changes: 4 additions & 1 deletion sysdeps/posix/getaddrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,10 @@ get_scope (const struct sockaddr_in6 *in6)
{
if (! IN6_IS_ADDR_MULTICAST (&in6->sin6_addr))
{
if (IN6_IS_ADDR_LINKLOCAL (&in6->sin6_addr))
if (IN6_IS_ADDR_LINKLOCAL (&in6->sin6_addr)
/* RFC 4291 2.5.3 says that the loopback address is to be
treated like a link-local address. */
|| IN6_IS_ADDR_LOOPBACK (&in6->sin6_addr))
scope = 2;
else if (IN6_IS_ADDR_SITELOCAL (&in6->sin6_addr))
scope = 5;
Expand Down

0 comments on commit 5fab554

Please sign in to comment.