*
* %sccs.include.redist.c%
*
- * @(#)uipc_usrreq.c 7.38 (Berkeley) %G%
+ * @(#)uipc_usrreq.c 8.2 (Berkeley) %G%
*/
#include <sys/param.h>
unp->unp_socket->so_pcb = 0;
m_freem(unp->unp_addr);
(void) m_free(dtom(unp));
- if (unp_rights)
+ if (unp_rights) {
+ /*
+ * Normally the receive buffer is flushed later,
+ * in sofree, but if our receive buffer holds references
+ * to descriptors that are now garbage, we will dispose
+ * of those descriptor references after the garbage collector
+ * gets them (resulting in a "panic: closef: count < 0").
+ */
+ sorflush(unp->unp_socket);
unp_gc();
+ }
}
unp_bind(unp, nam, p)
}
VATTR_NULL(&vattr);
vattr.va_type = VSOCK;
- vattr.va_mode = 0777;
+ vattr.va_mode = ACCESSPERMS;
LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
if (error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr))
return (error);