Commit 7863157d83763a0f1b9ad96c94a1ed3d0372526a
Committed by
John W. Linville
1 parent
ac55d2fe05
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
mac80211: fix network header location when adding encryption headers
Update the location of the network header when adding encryption specific headers to a skb. This allows low-level drivers to use the (now correct) location of the network header. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Showing 2 changed files with 3 additions and 0 deletions Side-by-side Diff
net/mac80211/wep.c
... | ... | @@ -111,6 +111,7 @@ |
111 | 111 | (info->control.hw_key->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)) |
112 | 112 | return newhdr + hdrlen; |
113 | 113 | |
114 | + skb_set_network_header(skb, skb_network_offset(skb) + WEP_IV_LEN); | |
114 | 115 | ieee80211_wep_get_iv(local, keylen, keyidx, newhdr + hdrlen); |
115 | 116 | return newhdr + hdrlen; |
116 | 117 | } |
net/mac80211/wpa.c
... | ... | @@ -203,6 +203,7 @@ |
203 | 203 | |
204 | 204 | pos = skb_push(skb, TKIP_IV_LEN); |
205 | 205 | memmove(pos, pos + TKIP_IV_LEN, hdrlen); |
206 | + skb_set_network_header(skb, skb_network_offset(skb) + TKIP_IV_LEN); | |
206 | 207 | pos += hdrlen; |
207 | 208 | |
208 | 209 | /* the HW only needs room for the IV, but not the actual IV */ |
... | ... | @@ -428,6 +429,7 @@ |
428 | 429 | |
429 | 430 | pos = skb_push(skb, CCMP_HDR_LEN); |
430 | 431 | memmove(pos, pos + CCMP_HDR_LEN, hdrlen); |
432 | + skb_set_network_header(skb, skb_network_offset(skb) + CCMP_HDR_LEN); | |
431 | 433 | |
432 | 434 | /* the HW only needs room for the IV, but not the actual IV */ |
433 | 435 | if (info->control.hw_key && |