net80211: Merge a memory leak fix from FreeBSD.
This commit is contained in:
@@ -662,14 +662,15 @@ ieee80211_crypto_decap(struct ieee80211_node *ni, struct mbuf *m, int hdrlen,
|
|||||||
k = &ni->ni_ucastkey;
|
k = &ni->ni_ucastkey;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Insure crypto header is contiguous for all decap work.
|
* Insure crypto header is contiguous and long enough for all
|
||||||
|
* decap work.
|
||||||
*/
|
*/
|
||||||
cip = k->wk_cipher;
|
cip = k->wk_cipher;
|
||||||
if (m->m_len < hdrlen + cip->ic_header &&
|
if (m->m_len < hdrlen + cip->ic_header) {
|
||||||
(m = m_pullup(m, hdrlen + cip->ic_header)) == NULL) {
|
|
||||||
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2,
|
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2,
|
||||||
"unable to pullup %s header", cip->ic_name);
|
"frame is too short (%d < %u) for crypto decap",
|
||||||
vap->iv_stats.is_rx_wepfail++; /* XXX */
|
cip->ic_name, m->m_len, hdrlen + cip->ic_header);
|
||||||
|
vap->iv_stats.is_rx_tooshort++;
|
||||||
*key = NULL;
|
*key = NULL;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user