Author: mjg
Date: Tue Jul  2 07:36:04 2013
New Revision: 252502
URL: http://svnweb.freebsd.org/changeset/base/252502

Log:
  Fix receiving fd over unix socket broken in r247740.
  
  If n fds were passed, it would receive the first one n times.
  
  Reported by:  Shawn Webb <latt...@gmail.com>, koobs, gleb
  Tested by:    koobs, gleb
  Reviewed by:  pjd

Modified:
  head/sys/kern/uipc_usrreq.c

Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c Tue Jul  2 07:35:57 2013        (r252501)
+++ head/sys/kern/uipc_usrreq.c Tue Jul  2 07:36:04 2013        (r252502)
@@ -1764,8 +1764,8 @@ unp_externalize(struct mbuf *control, st
                        }
                        for (i = 0; i < newfds; i++, fdp++) {
                                fde = &fdesc->fd_ofiles[*fdp];
-                               fde->fde_file = fdep[0]->fde_file;
-                               filecaps_move(&fdep[0]->fde_caps,
+                               fde->fde_file = fdep[i]->fde_file;
+                               filecaps_move(&fdep[i]->fde_caps,
                                    &fde->fde_caps);
                                if ((flags & MSG_CMSG_CLOEXEC) != 0)
                                        fde->fde_flags |= UF_EXCLOSE;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to