Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/uipc_socket.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/uipc_socket.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.54 retrieving revision 1.60 diff -u -p -r1.54 -r1.60 --- src/sys/kern/uipc_socket.c 2001/02/27 05:19:13 1.54 +++ src/sys/kern/uipc_socket.c 2002/01/03 01:11:26 1.60 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.54 2001/02/27 05:19:13 lukem Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.60 2002/01/03 01:11:26 mrg Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993 @@ -35,6 +35,9 @@ * @(#)uipc_socket.c 8.6 (Berkeley) 5/2/95 */ +#include +__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.60 2002/01/03 01:11:26 mrg Exp $"); + #include "opt_compat_sunos.h" #include @@ -109,7 +112,7 @@ socreate(int dom, struct socket **aso, i splx(s); return (error); } -#ifdef COMPAT_SUNOS +#if defined(COMPAT_SUNOS) && 0 /* moved into compat/sunos */ { extern struct emul emul_sunos; if (p->p_emul == &emul_sunos && type == SOCK_DGRAM) @@ -256,7 +259,8 @@ soaccept(struct socket *so, struct mbuf if ((so->so_state & SS_NOFDREF) == 0) panic("soaccept: !NOFDREF"); so->so_state &= ~SS_NOFDREF; - if ((so->so_state & SS_ISDISCONNECTED) == 0) + if ((so->so_state & SS_ISDISCONNECTED) == 0 || + (so->so_proto->pr_flags & PR_ABRTACPTDIS) == 0) error = (*so->so_proto->pr_usrreq)(so, PRU_ACCEPT, (struct mbuf *)0, nam, (struct mbuf *)0, (struct proc *)0); else @@ -352,8 +356,8 @@ sosend(struct socket *so, struct mbuf *a { struct proc *p; struct mbuf **mp, *m; - long space, len, resid; - int clen, error, s, dontroute, mlen, atomic; + long space, len, resid, clen, mlen; + int error, s, dontroute, atomic; p = curproc; /* XXX */ clen = 0; @@ -446,19 +450,19 @@ sosend(struct socket *so, struct mbuf *a goto nopages; mlen = MCLBYTES; #ifdef MAPPED_MBUFS - len = min(MCLBYTES, resid); + len = lmin(MCLBYTES, resid); #else if (atomic && top == 0) { - len = min(MCLBYTES - max_hdr, + len = lmin(MCLBYTES - max_hdr, resid); m->m_data += max_hdr; } else - len = min(MCLBYTES, resid); + len = lmin(MCLBYTES, resid); #endif space -= len; } else { nopages: - len = min(min(mlen, resid), space); + len = lmin(lmin(mlen, resid), space); space -= len; /* * For datagram protocols, leave room @@ -735,6 +739,8 @@ soreceive(struct socket *so, struct mbuf splx(s); error = uiomove(mtod(m, caddr_t) + moff, (int)len, uio); s = splsoftnet(); + if (error) + goto release; } else uio->uio_resid -= len; if (len == m->m_len - moff) { @@ -862,7 +868,7 @@ sorflush(struct socket *so) pr = so->so_proto; sb->sb_flags |= SB_NOINTR; (void) sblock(sb, M_WAITOK); - s = splimp(); + s = splnet(); socantrcvmore(so); sbunlock(sb); asb = *sb;