chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / debian / patches / any / cvs-getaddrinfo.diff
1 2010-03-26  Ulrich Drepper  <drepper@redhat.com>
2
3         * sysdeps/posix/getaddrinfo.c (gaih_inet): Don't assume success always
4         means aborting the loop over the NSS methods.
5  
6 ---
7  sysdeps/posix/getaddrinfo.c |   21 +++++++++++----------
8  1 file changed, 11 insertions(+), 10 deletions(-)
9
10 --- a/sysdeps/posix/getaddrinfo.c
11 +++ b/sysdeps/posix/getaddrinfo.c
12 @@ -817,17 +817,18 @@
13                                     canon = name;
14                                 }
15                             }
16 -
17 -                         break;
18 +                         status = NSS_STATUS_SUCCESS;
19 +                       }
20 +                     else
21 +                       {
22 +                         /* We can have different states for AF_INET and
23 +                            AF_INET6.  Try to find a useful one for both.  */
24 +                         if (inet6_status == NSS_STATUS_TRYAGAIN)
25 +                           status = NSS_STATUS_TRYAGAIN;
26 +                         else if (status == NSS_STATUS_UNAVAIL
27 +                                  && inet6_status != NSS_STATUS_UNAVAIL)
28 +                           status = inet6_status;
29                         }
30 -
31 -                     /* We can have different states for AF_INET and
32 -                        AF_INET6.  Try to find a useful one for both.  */
33 -                     if (inet6_status == NSS_STATUS_TRYAGAIN)
34 -                       status = NSS_STATUS_TRYAGAIN;
35 -                     else if (status == NSS_STATUS_UNAVAIL
36 -                              && inet6_status != NSS_STATUS_UNAVAIL)
37 -                       status = inet6_status;
38                     }
39                   else
40                     status = NSS_STATUS_UNAVAIL;