Date: Wed, 19 Nov 2014 05:43:32 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r274685 - projects/sendfile/sys/netinet Message-ID: <201411190543.sAJ5hW8S009431@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Wed Nov 19 05:43:31 2014 New Revision: 274685 URL: https://svnweb.freebsd.org/changeset/base/274685 Log: In tcp_usr_send() if the pcb appears to be dropped, avoid freeing M_NOTREADY mbufs. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: projects/sendfile/sys/netinet/tcp_usrreq.c Modified: projects/sendfile/sys/netinet/tcp_usrreq.c ============================================================================== --- projects/sendfile/sys/netinet/tcp_usrreq.c Wed Nov 19 05:38:45 2014 (r274684) +++ projects/sendfile/sys/netinet/tcp_usrreq.c Wed Nov 19 05:43:31 2014 (r274685) @@ -821,7 +821,11 @@ tcp_usr_send(struct socket *so, int flag if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { if (control) m_freem(control); - if (m) + /* + * In case of PRUS_NOTREADY, tcp_usr_ready() is responsible + * for freeing memory. + */ + if (m && (flags & PRUS_NOTREADY) == 0) m_freem(m); error = ECONNRESET; goto out;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411190543.sAJ5hW8S009431>