summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2006-03-15 21:27:08 +0000
committersam <sam@FreeBSD.org>2006-03-15 21:27:08 +0000
commitabccf6f3e27b07055242c9c80666260c85d09e6a (patch)
tree2aad31584f0fefa440237cb6d57aa6bf4822753d /sys/net80211
parent50c2d936c43eb02fa1e63a9481bb1adcef1e5857 (diff)
downloadFreeBSD-src-abccf6f3e27b07055242c9c80666260c85d09e6a.zip
FreeBSD-src-abccf6f3e27b07055242c9c80666260c85d09e6a.tar.gz
when doing s/w crypto make sure work is done w/ a writable mbuf chain;
this corrects problems with drivers that rely on the host to do crypto (iwi, ipw, ral, ural, wi (hostap), awi) Hard work by: luigi, mlaier Reviewed by: luigi, mlaier MFC after: 1 week
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_output.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 919c5a8..9dfbb8d 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -384,6 +384,21 @@ ieee80211_mbuf_adjust(struct ieee80211com *ic, int hdrsize,
/* XXX belongs in crypto code? */
needed_space += key->wk_cipher->ic_header;
/* XXX frags */
+ /*
+ * When crypto is being done in the host we must insure
+ * the data are writable for the cipher routines; clone
+ * a writable mbuf chain.
+ * XXX handle SWMIC specially
+ */
+ if (key->wk_flags & (IEEE80211_KEY_SWCRYPT|IEEE80211_KEY_SWMIC)) {
+ m = m_unshare(m, M_NOWAIT);
+ if (m == NULL) {
+ IEEE80211_DPRINTF(ic, IEEE80211_MSG_OUTPUT,
+ "%s: cannot get writable mbuf\n", __func__);
+ ic->ic_stats.is_tx_nobuf++; /* XXX new stat */
+ return NULL;
+ }
+ }
}
/*
* We know we are called just before stripping an Ethernet
OpenPOWER on IntegriCloud