diff options
Diffstat (limited to 'net/mac80211/wpa.c')
-rw-r--r-- | net/mac80211/wpa.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 0ae23c60968c..bdb53aba888e 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -183,7 +183,8 @@ static int tkip_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
183 | u8 *pos; | 183 | u8 *pos; |
184 | 184 | ||
185 | if (info->control.hw_key && | 185 | if (info->control.hw_key && |
186 | !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV)) { | 186 | !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) && |
187 | !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)) { | ||
187 | /* hwaccel - with no need for software-generated IV */ | 188 | /* hwaccel - with no need for software-generated IV */ |
188 | return 0; | 189 | return 0; |
189 | } | 190 | } |
@@ -202,8 +203,14 @@ static int tkip_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
202 | 203 | ||
203 | pos = skb_push(skb, TKIP_IV_LEN); | 204 | pos = skb_push(skb, TKIP_IV_LEN); |
204 | memmove(pos, pos + TKIP_IV_LEN, hdrlen); | 205 | memmove(pos, pos + TKIP_IV_LEN, hdrlen); |
206 | skb_set_network_header(skb, skb_network_offset(skb) + TKIP_IV_LEN); | ||
205 | pos += hdrlen; | 207 | pos += hdrlen; |
206 | 208 | ||
209 | /* the HW only needs room for the IV, but not the actual IV */ | ||
210 | if (info->control.hw_key && | ||
211 | (info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)) | ||
212 | return 0; | ||
213 | |||
207 | /* Increase IV for the frame */ | 214 | /* Increase IV for the frame */ |
208 | spin_lock_irqsave(&key->u.tkip.txlock, flags); | 215 | spin_lock_irqsave(&key->u.tkip.txlock, flags); |
209 | key->u.tkip.tx.iv16++; | 216 | key->u.tkip.tx.iv16++; |
@@ -422,6 +429,7 @@ static int ccmp_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb) | |||
422 | 429 | ||
423 | pos = skb_push(skb, CCMP_HDR_LEN); | 430 | pos = skb_push(skb, CCMP_HDR_LEN); |
424 | memmove(pos, pos + CCMP_HDR_LEN, hdrlen); | 431 | memmove(pos, pos + CCMP_HDR_LEN, hdrlen); |
432 | skb_set_network_header(skb, skb_network_offset(skb) + CCMP_HDR_LEN); | ||
425 | 433 | ||
426 | /* the HW only needs room for the IV, but not the actual IV */ | 434 | /* the HW only needs room for the IV, but not the actual IV */ |
427 | if (info->control.hw_key && | 435 | if (info->control.hw_key && |