diff options
author | sam <sam@FreeBSD.org> | 2002-12-30 20:22:40 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2002-12-30 20:22:40 +0000 |
commit | b16cb0a948acd6a3b5f47aa494607a001944c194 (patch) | |
tree | 984c2041a8941be016b4cab972816b51adcc818d /sys/dev/awi | |
parent | 83fcaa45a1be401bd2ecafa45dbfb492a71532b7 (diff) | |
download | FreeBSD-src-b16cb0a948acd6a3b5f47aa494607a001944c194.zip FreeBSD-src-b16cb0a948acd6a3b5f47aa494607a001944c194.tar.gz |
Correct mbuf packet header propagation. Previously, packet headers
were sometimes propagated using M_COPY_PKTHDR which actually did
something between a "move" and a "copy" operation. This is replaced
by M_MOVE_PKTHDR (which copies the pkthdr contents and "removes" it
from the source mbuf) and m_dup_pkthdr which copies the packet
header contents including any m_tag chain. This corrects numerous
problems whereby mbuf tags could be lost during packet manipulations.
These changes also introduce arguments to m_tag_copy and m_tag_copy_chain
to specify if the tag copy work should potentially block. This
introduces an incompatibility with openbsd which we may want to revisit.
Note that move/dup of packet headers does not handle target mbufs
that have a cluster bound to them. We may want to support this;
for now we watch for it with an assert.
Finally, M_COPYFLAGS was updated to include M_FIRSTFRAG|M_LASTFRAG.
Supported by: Vernier Networks
Reviewed by: Robert Watson <rwatson@FreeBSD.org>
Diffstat (limited to 'sys/dev/awi')
-rw-r--r-- | sys/dev/awi/awi.c | 2 | ||||
-rw-r--r-- | sys/dev/awi/awi_wep.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/awi/awi.c b/sys/dev/awi/awi.c index 3718198..e77fae6 100644 --- a/sys/dev/awi/awi.c +++ b/sys/dev/awi/awi.c @@ -1326,7 +1326,7 @@ awi_fix_rxhdr(sc, m0) m_freem(m0); return NULL; } - M_COPY_PKTHDR(n, m0); + M_MOVE_PKTHDR(n, m0); n->m_len = MHLEN; } else { MGET(n, M_DONTWAIT, MT_DATA); diff --git a/sys/dev/awi/awi_wep.c b/sys/dev/awi/awi_wep.c index b24bd9f..ecaf548 100644 --- a/sys/dev/awi/awi_wep.c +++ b/sys/dev/awi/awi_wep.c @@ -323,7 +323,7 @@ awi_wep_encrypt(sc, m0, txflag) n0 = n; if (n == NULL) goto fail; - M_COPY_PKTHDR(n, m); + M_MOVE_PKTHDR(n, m); len = IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN; if (txflag) { n->m_pkthdr.len += len; |