]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix recvmsg returning SIGLOST on PF_LOCAL sockets
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 8 Aug 2016 23:42:50 +0000 (01:42 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 8 Aug 2016 23:42:50 +0000 (01:42 +0200)
when msg_name is not NULL.

* sysdeps/mach/hurd/recvmsg.c (__libc_recvmsg): Cope with aport being
MACH_PORT_NULL.

ChangeLog
sysdeps/mach/hurd/recvmsg.c

index d244dccfbe7414806aeabdb085aec36ba8f465e5..d8ba9cd57d8547772c6d98c970355b532df8b186 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-08-06  Christian Seiler  <christian@iwakd.de>
+
+       [BZ #20444]
+       * sysdeps/mach/hurd/recvmsg.c (__libc_recvmsg): Cope with aport being
+       MACH_PORT_NULL.
+
 2016-08-05  Aurelien Jarno  <aurelien@aurel32.net>
 
        * math/s_fdim.c: Avoid alias renamed.
index 770a42e05e5b1fdf1d471961f62f3395ba6659da..51cfbd7cdb75affe1f26cdb53347896efca3013e 100644 (file)
@@ -64,7 +64,7 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags)
                                               &message->msg_flags, amount)))
     return __hurd_sockfail (fd, flags, err);
 
-  if (message->msg_name != NULL)
+  if (message->msg_name != NULL && aport != MACH_PORT_NULL)
     {
       char *buf = message->msg_name;
       mach_msg_type_number_t buflen = message->msg_namelen;
@@ -98,6 +98,8 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags)
       if (buflen > 0)
        ((struct sockaddr *) message->msg_name)->sa_family = type;
     }
+  else if (message->msg_name != NULL)
+    message->msg_namelen = 0;
 
   __mach_port_deallocate (__mach_task_self (), aport);