This is the mail archive of the glibc-cvs@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]

GNU C Library master sources branch, master, updated. glibc-2.14-40-gfa3fc0f


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  fa3fc0fe5f452d0aa7e435d8f32e992958683819 (commit)
       via  e12df166d37522c2ed434c2d70a1b04640d2d7c6 (commit)
      from  84e2a551a72c79b020694bb327e33b6d71b09b63 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fa3fc0fe5f452d0aa7e435d8f32e992958683819

commit fa3fc0fe5f452d0aa7e435d8f32e992958683819
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Wed Jun 22 15:00:54 2011 -0400

    Avoid __check_pf calls in getaddrinfo unless really needed

diff --git a/ChangeLog b/ChangeLog
index 33b7703..ad7303f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-06-22  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #12907]
+	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Avoid calling __check_pf
+	until it is clear that the information is realy needed.
+	Patch mostly by David Hanisch <david.hanisch@nsn.com>.
+
 2011-06-22  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gaih_inet): Fix last change.
diff --git a/NEWS b/NEWS
index 9e6832c..5a7ffc2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2011-6-21
+GNU C Library NEWS -- history of user-visible changes.  2011-6-22
 Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -9,7 +9,7 @@ Version 2.15
 
 * The following bugs are resolved with this release:
 
-  12885
+  12885, 12907
 
 * New program pldd to list loaded object of a process
   Implemented by Ulrich Drepper.
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 14e9270..05c883d 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -2352,14 +2352,17 @@ getaddrinfo (const char *name, const char *service,
   size_t in6ailen = 0;
   bool seen_ipv4 = false;
   bool seen_ipv6 = false;
-  /* We might need information about what interfaces are available.
-     Also determine whether we have IPv4 or IPv6 interfaces or both.  We
-     cannot cache the results since new interfaces could be added at
-     any time.  */
-  __check_pf (&seen_ipv4, &seen_ipv6, &in6ai, &in6ailen);
+  bool check_pf_called = false;
 
   if (hints->ai_flags & AI_ADDRCONFIG)
     {
+      /* We might need information about what interfaces are available.
+	 Also determine whether we have IPv4 or IPv6 interfaces or both.  We
+	 cannot cache the results since new interfaces could be added at
+	 any time.  */
+      __check_pf (&seen_ipv4, &seen_ipv6, &in6ai, &in6ailen);
+      check_pf_called = true;
+
       /* Now make a decision on what we return, if anything.  */
       if (hints->ai_family == PF_UNSPEC && (seen_ipv4 || seen_ipv6))
 	{
@@ -2441,6 +2444,10 @@ getaddrinfo (const char *name, const char *service,
       struct addrinfo *last = NULL;
       char *canonname = NULL;
 
+      /* Now we definitely need the interface information.  */
+      if (! check_pf_called)
+	__check_pf (&seen_ipv4, &seen_ipv6, &in6ai, &in6ailen);
+
       /* If we have information about deprecated and temporary addresses
 	 sort the array now.  */
       if (in6ai != NULL)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e12df166d37522c2ed434c2d70a1b04640d2d7c6

commit e12df166d37522c2ed434c2d70a1b04640d2d7c6
Author: Andreas Schwab <schwab@redhat.com>
Date:   Wed Jun 22 14:35:49 2011 -0400

    Fix Ipv4&IPv6 lookup in getaddrinfo
    
    Problem introduced in the last patch.

diff --git a/ChangeLog b/ChangeLog
index 68409c9..33b7703 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-06-22  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Fix last change.
+
 2011-06-22  Ulrich Drepper  <drepper@gmail.com>
 
 	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Use
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 3a2737e..14e9270 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -894,7 +894,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 			      pat = &((*pat)->next);
 			      no_data = 0;
 			    }
-			  else if ((*pat)->family == AF_UNSPEC
+			  else if (req->ai_family == AF_UNSPEC
 				   || (*pat)->family == req->ai_family)
 			    {
 			      pat = &((*pat)->next);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                   |   11 +++++++++++
 NEWS                        |    4 ++--
 sysdeps/posix/getaddrinfo.c |   19 +++++++++++++------
 3 files changed, 26 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


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