svn commit: r275955 - head/sys/kern
Gleb Smirnoff
glebius at FreeBSD.org
Sat Dec 20 14:19:47 UTC 2014
Author: glebius
Date: Sat Dec 20 14:19:46 2014
New Revision: 275955
URL: https://svnweb.freebsd.org/changeset/base/275955
Log:
Add to sbappendstream_locked() a check against NULL mbuf, like it is done
in sbappend_locked() and sbappendrecord_locked().
This is a quick fix to the panic introduced by r274712.
A proper solution should be to make sosend_generic() avoid calling
pru_send() with NULL mbuf for the protocols that do not understand
control messages. Those protocols that understand control messages,
should be able to receive NULL mbuf, if control is non-NULL.
Modified:
head/sys/kern/uipc_sockbuf.c
Modified: head/sys/kern/uipc_sockbuf.c
==============================================================================
--- head/sys/kern/uipc_sockbuf.c Sat Dec 20 13:47:38 2014 (r275954)
+++ head/sys/kern/uipc_sockbuf.c Sat Dec 20 14:19:46 2014 (r275955)
@@ -640,6 +640,9 @@ sbappendstream_locked(struct sockbuf *sb
{
SOCKBUF_LOCK_ASSERT(sb);
+ if (m == NULL)
+ return;
+
KASSERT(m->m_nextpkt == NULL,("sbappendstream 0"));
KASSERT(sb->sb_mb == sb->sb_lastrecord,("sbappendstream 1"));
More information about the svn-src-head
mailing list