summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_esp.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_esp.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_esp.c')
-rw-r--r--sys/netinet/ip_esp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c
index e21b373d14b..bf3e4aab7ad 100644
--- a/sys/netinet/ip_esp.c
+++ b/sys/netinet/ip_esp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_esp.c,v 1.95 2005/08/05 12:16:13 markus Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.96 2005/12/20 13:36:28 markus Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -835,13 +835,12 @@ esp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
}
/*
- * 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;
}