Date: Thu, 28 Oct 2010 16:53:54 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r214461 - stable/8/sys/kern Message-ID: <201010281653.o9SGrsVT017372@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Thu Oct 28 16:53:54 2010 New Revision: 214461 URL: http://svn.freebsd.org/changeset/base/214461 Log: MFC r211030: Fix a bug where MSG_TRUNC was not returned in all necessary cases for SOCK_DGRAM socket. MSG_TRUNC was only returned when some mbufs could not be copied to the application. If some data was left in the last mbuf, it was correctly discarded, but MSG_TRUNC was not set. Modified: stable/8/sys/kern/uipc_socket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/uipc_socket.c ============================================================================== --- stable/8/sys/kern/uipc_socket.c Thu Oct 28 16:51:57 2010 (r214460) +++ stable/8/sys/kern/uipc_socket.c Thu Oct 28 16:53:54 2010 (r214461) @@ -2225,7 +2225,12 @@ soreceive_dgram(struct socket *so, struc m_freem(m); return (error); } - m = m_free(m); + if (len == m->m_len) + m = m_free(m); + else { + m->m_data += len; + m->m_len -= len; + } } if (m != NULL) flags |= MSG_TRUNC;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010281653.o9SGrsVT017372>