Date: Mon, 15 Feb 1999 13:41:55 PST From: Bill Fenner <fenner@parc.xerox.com> To: Chris Csanady <ccsanady@friley-185-205.res.iastate.edu> Cc: freebsd-net@FreeBSD.ORG Subject: Re: Serious mbuf cluster leak.. Message-ID: <99Feb15.134201pst.177534@crevenia.parc.xerox.com> In-Reply-To: Your message of "Thu, 11 Feb 99 01:43:43 PST." <19990211094343.960A410@friley-185-205.res.iastate.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99Feb15.134201pst.177534>