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/21926] New: getaddrinfo: INET/INET6 status consolidation does not update errno, h_errno


https://sourceware.org/bugzilla/show_bug.cgi?id=21926

            Bug ID: 21926
           Summary: getaddrinfo: INET/INET6 status consolidation does not
                    update errno, h_errno
           Product: glibc
           Version: 2.26
            Status: NEW
          Severity: normal
          Priority: P2
         Component: network
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---

There is a bit of code to consolidate status between AF_INET and AF_INET6
responses:

                        {
                          /* We can have different states for AF_INET and
                             AF_INET6.  Try to find a useful one for both.  */
                          if (inet6_status == NSS_STATUS_TRYAGAIN)
                            status = NSS_STATUS_TRYAGAIN;
                          else if (status == NSS_STATUS_UNAVAIL
                                   && inet6_status != NSS_STATUS_UNAVAIL)
                            status = inet6_status;
                        }

AF_INET6 is queried first, then AF_INET.  This means that if ient6_status ==
NSS_STATUS_TRYAGAIN, the errno and h_errno values may have been clobbered by
the AF_INET.

We probably should not perform the second query if the first query with
NSS_STATUS_TRYAGAIN or NSS_STATUS_UNAVAIL.

-- 
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]