summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ipcomp.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2005-12-20 13:36:29 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2005-12-20 13:36:29 +0000
commit8181ef81922d023fe70f58695ff1f040fce31bc8 (patch)
tree4133189f41804db0bde2f042f53f5965ac534f1e /sys/netinet/ip_ipcomp.c
parent1db9a0b4b1d19fa2db986d7be13de0b5e1da93aa (diff)
use M_READONLY when trying to find out whether we have to copy
the mbuf before encryption. otherwise mbufs with M_EXT but w/o M_CLUSTER get modified; ok hshoexer
Diffstat (limited to 'sys/netinet/ip_ipcomp.c')
-rw-r--r--sys/netinet/ip_ipcomp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/ip_ipcomp.c b/sys/netinet/ip_ipcomp.c
index a1a1f2d0f4d..a7a52dd1bc6 100644
--- a/sys/netinet/ip_ipcomp.c
+++ b/sys/netinet/ip_ipcomp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipcomp.c,v 1.18 2005/07/31 03:52:19 pascoe Exp $ */
+/* $OpenBSD: ip_ipcomp.c,v 1.19 2005/12/20 13:36:28 markus Exp $ */
/*
* Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org)
@@ -464,13 +464,12 @@ ipcomp_output(m, tdb, mp, skip, protoff)
tdb->tdb_flags &= ~TDBF_SOFT_BYTES; /* Turn off checking */
}
/*
- * Loop through mbuf chain; if we find an M_EXT mbuf with
- * more than one reference, replace the rest of the chain.
+ * Loop through mbuf chain; if we find a readonly mbuf,
+ * replace the rest of the chain.
*/
mo = NULL;
mi = m;
- while (mi != NULL &&
- (!(mi->m_flags & M_EXT) || !MCLISREFERENCED(mi))) {
+ while (mi != NULL && !M_READONLY(mi)) {
mo = mi;
mi = mi->m_next;
}