|
@@ -1540,7 +1540,7 @@ ath5k_rx_decrypted(struct ath5k_softc *sc, struct ath5k_desc *ds,
|
|
|
struct sk_buff *skb, struct ath5k_rx_status *rs)
|
|
|
{
|
|
|
struct ieee80211_hdr *hdr = (void *)skb->data;
|
|
|
- unsigned int keyix, hlen = ieee80211_get_hdrlen_from_skb(skb);
|
|
|
+ unsigned int keyix, hlen;
|
|
|
|
|
|
if (!(rs->rs_status & AR5K_RXERR_DECRYPT) &&
|
|
|
rs->rs_keyix != AR5K_RXKEYIX_INVALID)
|
|
@@ -1549,6 +1549,7 @@ ath5k_rx_decrypted(struct ath5k_softc *sc, struct ath5k_desc *ds,
|
|
|
/* Apparently when a default key is used to decrypt the packet
|
|
|
the hw does not set the index used to decrypt. In such cases
|
|
|
get the index from the packet. */
|
|
|
+ hlen = ieee80211_hdrlen(hdr->frame_control);
|
|
|
if (ieee80211_has_protected(hdr->frame_control) &&
|
|
|
!(rs->rs_status & AR5K_RXERR_DECRYPT) &&
|
|
|
skb->len >= hlen + 4) {
|