diff options
author | 2005-12-20 13:36:28 +0000 | |
---|---|---|
committer | 2005-12-20 13:36:28 +0000 | |
commit | 38d7d608976e357bdab36501396c6dc495edb34e (patch) | |
tree | b5f2de62872e9689e42fb5832aa828c3f2102bbc /sys/netinet/ip_ipcomp.c | |
parent | format according to Notes; (diff) | |
download | wireguard-openbsd-38d7d608976e357bdab36501396c6dc495edb34e.tar.xz wireguard-openbsd-38d7d608976e357bdab36501396c6dc495edb34e.zip |
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.c | 9 |
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; } |