From owner-freebsd-net Mon Feb 15 13:42:14 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA10889 for freebsd-net-outgoing; Mon, 15 Feb 1999 13:42:14 -0800 (PST) (envelope-from owner-freebsd-net@FreeBSD.ORG) Received: from alpha.xerox.com (alpha.Xerox.COM [13.1.64.93]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id NAA10882 for ; Mon, 15 Feb 1999 13:42:11 -0800 (PST) (envelope-from fenner@parc.xerox.com) Received: from crevenia.parc.xerox.com ([13.2.116.11]) by alpha.xerox.com with SMTP id <53433(1)>; Mon, 15 Feb 1999 13:42:08 PST Received: from localhost by crevenia.parc.xerox.com with SMTP id <177534>; Mon, 15 Feb 1999 13:42:01 -0800 To: Chris Csanady cc: freebsd-net@FreeBSD.ORG Subject: Re: Serious mbuf cluster leak.. In-reply-to: Your message of "Thu, 11 Feb 99 01:43:43 PST." <19990211094343.960A410@friley-185-205.res.iastate.edu> Date: Mon, 15 Feb 1999 13:41:55 PST From: Bill Fenner Message-Id: <99Feb15.134201pst.177534@crevenia.parc.xerox.com> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I found a bug yesterday in uipc_socket.c; try this patch. Bill Index: uipc_socket.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_socket.c,v retrieving revision 1.51 diff -u -r1.51 uipc_socket.c --- uipc_socket.c 1999/01/20 17:45:22 1.51 +++ uipc_socket.c 1999/02/15 07:09:25 @@ -388,6 +405,7 @@ register long space, len, resid; int clen = 0, error, s, dontroute, mlen; int atomic = sosendallatonce(so) || top; + int pru_flags; if (uio) resid = uio->uio_resid; @@ -518,21 +536,24 @@ } while (space > 0 && atomic); if (dontroute) so->so_options |= SO_DONTROUTE; + pru_flags = 0; + if (flags & MSG_OOB) + pru_flags |= PRUS_OOB; + /* + * If the user set MSG_EOF, the protocol + * understands this flag and nothing left to + * send then set PRUS_EOF. + */ + if ((flags & MSG_EOF) && + (so->so_proto->pr_flags & PR_IMPLOPCL) && + (resid <= 0)) + pru_flags |= PRUS_EOF; + /* If there is more to send set PRUS_MORETOCOME */ + if (resid > 0 && space > 0) + pru_flags |= PRUS_MORETOCOME; s = splnet(); /* XXX */ error = (*so->so_proto->pr_usrreqs->pru_send)(so, - (flags & MSG_OOB) ? PRUS_OOB : - /* - * If the user set MSG_EOF, the protocol - * understands this flag and nothing left to - * send then use PRU_SEND_EOF instead of PRU_SEND. - */ - ((flags & MSG_EOF) && - (so->so_proto->pr_flags & PR_IMPLOPCL) && - (resid <= 0)) ? - PRUS_EOF : - /* If there is more to send set PRUS_MORETOCOME */ - (resid > 0 && space > 0) ? PRUS_MORETOCOME : 0, - top, addr, control, p); + pru_flags, top, addr, control, p); splx(s); if (dontroute) so->so_options &= ~SO_DONTROUTE; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message