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.26-387-g6174537


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  6174537c24cfe324d6e8f5a2a421883df12b8b6a (commit)
      from  b38a42a098664a96842a23ef480d4b8c69ecd05c (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6174537c24cfe324d6e8f5a2a421883df12b8b6a

commit 6174537c24cfe324d6e8f5a2a421883df12b8b6a
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Sep 10 17:41:03 2017 +0200

    resolv_test.c: also cope with CONNREFUSED errors returned by recvfrom
    
    server_thread_udp_process_one already takes care of calling sendto()
    instead of xsendto to be able to ignore the case where the client has
    closed the socket.  Depending on the TCP/IP stack behavior, this error
    could be notified later through recvfrom(), so we need to ignore it
    there too.
    
    * support/resolv_test.c (server_thread_udp_process_one): Call recvfrom
    instead of xrecvfrom, and ignore ECONNREFUSED errors.

diff --git a/ChangeLog b/ChangeLog
index 1c44a53..84b1937 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,8 @@
 	(CMSG_FIRSTHDR, __cmsg_nxthdr): Use (struct cmsghdr *) 0 instead of
 	NULL.
 	* bits/socket.h: Likewise.
+	* support/resolv_test.c (server_thread_udp_process_one): Call recvfrom
+	instead of xrecvfrom, and ignore ECONNREFUSED errors.
 
 2017-09-22  Joseph Myers  <joseph@codesourcery.com>
 
diff --git a/support/resolv_test.c b/support/resolv_test.c
index 1625dcf..c3325b8 100644
--- a/support/resolv_test.c
+++ b/support/resolv_test.c
@@ -600,7 +600,7 @@ server_thread_udp_process_one (struct resolv_test *obj, int server_index)
   unsigned char query[512];
   struct sockaddr_storage peer;
   socklen_t peerlen = sizeof (peer);
-  size_t length = xrecvfrom (obj->servers[server_index].socket_udp,
+  ssize_t length = recvfrom (obj->servers[server_index].socket_udp,
                              query, sizeof (query), 0,
                              (struct sockaddr *) &peer, &peerlen);
   /* Check for termination.  */
@@ -613,6 +613,12 @@ server_thread_udp_process_one (struct resolv_test *obj, int server_index)
       return false;
   }
 
+  if (length < 0)
+    {
+      /* The other end had closed the socket, and we are notified only now. */
+      TEST_VERIFY_EXIT (errno == ECONNREFUSED);
+      return true;
+    }
 
   struct query_info qinfo;
   parse_query (&qinfo, query, length);

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

Summary of changes:
 ChangeLog             |    2 ++
 support/resolv_test.c |    8 +++++++-
 2 files changed, 9 insertions(+), 1 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]