summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-02-09 21:36:11 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-02-09 21:36:11 +0000
commit86113140779ab090e181a38986bc34b6e8235031 (patch)
treec8850ddc012fb435d6cc8efdf5d97b7a4c58fd69
parent8cf76b315ec7ab43f92f951f1f65090d612b2d08 (diff)
Don't panic if m_copyback() is working on a M_READONLY() mbuf. The old version
did not care either and with this packets from drivers with external buffers (e.g. wpi(4)) would trigger this panic through pf(4). Found the hard way by Tim van der Molen tbvdm (at) xs4all (dot) nl
-rw-r--r--sys/kern/uipc_mbuf.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index bb41329f098..200ec1dfa3c 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.117 2009/02/04 20:02:11 claudio Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.118 2009/02/09 21:36:10 claudio Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -739,8 +739,6 @@ m_copyback(struct mbuf *m0, int off, int len, const void *_cp)
m = m->m_next;
}
while (len > 0) {
- if (M_READONLY(m))
- panic("m_copyback called on a readonly cluster");
/* extend last packet to be filled fully */
if (m->m_next == NULL && (len > m->m_len - off))
m->m_len += min(len - (m->m_len - off),