Skip to content

Commit

Permalink
Merge tag 'mac80211-for-davem-2015-05-19' of git://git.kernel.org/pub…
Browse files Browse the repository at this point in the history
…/scm/linux/kernel/git/jberg/mac80211

Johannes Berg says:

====================
This has just a single fix, for a WEP tailroom check
problem that leads to dropped frames.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed May 19, 2015
2 parents b7b0ed9 + 47b4e1f commit 892bd62
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/mac80211/wep.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ static u8 *ieee80211_wep_add_iv(struct ieee80211_local *local,

hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);

if (WARN_ON(skb_tailroom(skb) < IEEE80211_WEP_ICV_LEN ||
skb_headroom(skb) < IEEE80211_WEP_IV_LEN))
if (WARN_ON(skb_headroom(skb) < IEEE80211_WEP_IV_LEN))
return NULL;

hdrlen = ieee80211_hdrlen(hdr->frame_control);
Expand Down Expand Up @@ -167,6 +166,9 @@ int ieee80211_wep_encrypt(struct ieee80211_local *local,
size_t len;
u8 rc4key[3 + WLAN_KEY_LEN_WEP104];

if (WARN_ON(skb_tailroom(skb) < IEEE80211_WEP_ICV_LEN))
return -1;

iv = ieee80211_wep_add_iv(local, skb, keylen, keyidx);
if (!iv)
return -1;
Expand Down

0 comments on commit 892bd62

Please sign in to comment.