diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-06-17 22:48:34 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-06-17 22:48:34 +0000 |
commit | a1677cd65490dc2dd3c35b441958968477f1181b (patch) | |
tree | b5105f3d5dc063a772657e2b7eebc5923364ee33 /sys/kern/uipc_sockbuf.c | |
parent | d9c30e05f502dcfd004e5fb113481e298cca349a (diff) | |
download | FreeBSD-src-a1677cd65490dc2dd3c35b441958968477f1181b.zip FreeBSD-src-a1677cd65490dc2dd3c35b441958968477f1181b.tar.gz |
Remove sbinsertoob(), sbinsertoob_locked(). They violate (and have
basically always violated) invariannts of soreceive(), which assume
that the first mbuf pointer in a receive socket buffer can't change
while the SB_LOCK sleepable lock is held on the socket buffer,
which is precisely what these functions do. No current protocols
invoke these functions, and removing them will help discourage them
from ever being used. I should have removed them years ago, but
lost track of it.
MFC after: 1 week
Prodded almost by accident by: peter
Diffstat (limited to 'sys/kern/uipc_sockbuf.c')
-rw-r--r-- | sys/kern/uipc_sockbuf.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index a39c685..de44554 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -757,70 +757,6 @@ sbappendrecord(sb, m0) } /* - * As above except that OOB data - * is inserted at the beginning of the sockbuf, - * but after any other OOB data. - */ -void -sbinsertoob_locked(sb, m0) - register struct sockbuf *sb; - register struct mbuf *m0; -{ - register struct mbuf *m; - register struct mbuf **mp; - - SOCKBUF_LOCK_ASSERT(sb); - - if (m0 == 0) - return; - for (mp = &sb->sb_mb; *mp ; mp = &((*mp)->m_nextpkt)) { - m = *mp; - again: - switch (m->m_type) { - - case MT_OOBDATA: - continue; /* WANT next train */ - - case MT_CONTROL: - m = m->m_next; - if (m) - goto again; /* inspect THIS train further */ - } - break; - } - /* - * Put the first mbuf on the queue. - * Note this permits zero length records. - */ - sballoc(sb, m0); - m0->m_nextpkt = *mp; - *mp = m0; - m = m0->m_next; - m0->m_next = 0; - if (m && (m0->m_flags & M_EOR)) { - m0->m_flags &= ~M_EOR; - m->m_flags |= M_EOR; - } - sbcompress(sb, m, m0); -} - -/* - * As above except that OOB data - * is inserted at the beginning of the sockbuf, - * but after any other OOB data. - */ -void -sbinsertoob(sb, m0) - register struct sockbuf *sb; - register struct mbuf *m0; -{ - - SOCKBUF_LOCK(sb); - sbinsertoob_locked(sb, m0); - SOCKBUF_UNLOCK(sb); -} - -/* * Append address and data, and optionally, control (ancillary) data * to the receive queue of a socket. If present, * m0 must include a packet header with total length. |