Commit eb9fb5b8883535c27d2cc5d4e4dbab3532f97b18
Committed by
John W. Linville
1 parent
a02ae758e8
Exists in
master
and in
7 other branches
mac80211: trim RX data
The RX data contains the netdev, which is duplicated since we have the sdata, and the RX status pointer, which is duplicate since we have the skb. Remove those two fields to have fewer fields that depend on each other and simply load them as necessary. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Showing 4 changed files with 61 additions and 54 deletions Side-by-side Diff
net/mac80211/ieee80211_i.h
... | ... | @@ -167,12 +167,10 @@ |
167 | 167 | |
168 | 168 | struct ieee80211_rx_data { |
169 | 169 | struct sk_buff *skb; |
170 | - struct net_device *dev; | |
171 | 170 | struct ieee80211_local *local; |
172 | 171 | struct ieee80211_sub_if_data *sdata; |
173 | 172 | struct sta_info *sta; |
174 | 173 | struct ieee80211_key *key; |
175 | - struct ieee80211_rx_status *status; | |
176 | 174 | struct ieee80211_rate *rate; |
177 | 175 | |
178 | 176 | unsigned int flags; |
net/mac80211/rx.c
... | ... | @@ -477,7 +477,7 @@ |
477 | 477 | { |
478 | 478 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; |
479 | 479 | unsigned int hdrlen = ieee80211_hdrlen(hdr->frame_control); |
480 | - char *dev_addr = rx->dev->dev_addr; | |
480 | + char *dev_addr = rx->sdata->dev->dev_addr; | |
481 | 481 | |
482 | 482 | if (ieee80211_is_data(hdr->frame_control)) { |
483 | 483 | if (is_multicast_ether_addr(hdr->addr1)) { |
... | ... | @@ -591,7 +591,9 @@ |
591 | 591 | static ieee80211_rx_result debug_noinline |
592 | 592 | ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx) |
593 | 593 | { |
594 | - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; | |
594 | + struct sk_buff *skb = rx->skb; | |
595 | + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | |
596 | + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | |
595 | 597 | int keyidx; |
596 | 598 | int hdrlen; |
597 | 599 | ieee80211_rx_result result = RX_DROP_UNUSABLE; |
... | ... | @@ -645,8 +647,8 @@ |
645 | 647 | return RX_CONTINUE; |
646 | 648 | } else if (mmie_keyidx >= 0) { |
647 | 649 | /* Broadcast/multicast robust management frame / BIP */ |
648 | - if ((rx->status->flag & RX_FLAG_DECRYPTED) && | |
649 | - (rx->status->flag & RX_FLAG_IV_STRIPPED)) | |
650 | + if ((status->flag & RX_FLAG_DECRYPTED) && | |
651 | + (status->flag & RX_FLAG_IV_STRIPPED)) | |
650 | 652 | return RX_CONTINUE; |
651 | 653 | |
652 | 654 | if (mmie_keyidx < NUM_DEFAULT_KEYS || |
... | ... | @@ -678,8 +680,8 @@ |
678 | 680 | * we somehow allow the driver to tell us which key |
679 | 681 | * the hardware used if this flag is set? |
680 | 682 | */ |
681 | - if ((rx->status->flag & RX_FLAG_DECRYPTED) && | |
682 | - (rx->status->flag & RX_FLAG_IV_STRIPPED)) | |
683 | + if ((status->flag & RX_FLAG_DECRYPTED) && | |
684 | + (status->flag & RX_FLAG_IV_STRIPPED)) | |
683 | 685 | return RX_CONTINUE; |
684 | 686 | |
685 | 687 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
... | ... | @@ -715,8 +717,8 @@ |
715 | 717 | /* Check for weak IVs if possible */ |
716 | 718 | if (rx->sta && rx->key->conf.alg == ALG_WEP && |
717 | 719 | ieee80211_is_data(hdr->frame_control) && |
718 | - (!(rx->status->flag & RX_FLAG_IV_STRIPPED) || | |
719 | - !(rx->status->flag & RX_FLAG_DECRYPTED)) && | |
720 | + (!(status->flag & RX_FLAG_IV_STRIPPED) || | |
721 | + !(status->flag & RX_FLAG_DECRYPTED)) && | |
720 | 722 | ieee80211_wep_is_weak_iv(rx->skb, rx->key)) |
721 | 723 | rx->sta->wep_weak_iv_count++; |
722 | 724 | |
... | ... | @@ -736,7 +738,7 @@ |
736 | 738 | } |
737 | 739 | |
738 | 740 | /* either the frame has been decrypted or will be dropped */ |
739 | - rx->status->flag |= RX_FLAG_DECRYPTED; | |
741 | + status->flag |= RX_FLAG_DECRYPTED; | |
740 | 742 | |
741 | 743 | return result; |
742 | 744 | } |
... | ... | @@ -816,7 +818,9 @@ |
816 | 818 | ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) |
817 | 819 | { |
818 | 820 | struct sta_info *sta = rx->sta; |
819 | - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; | |
821 | + struct sk_buff *skb = rx->skb; | |
822 | + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | |
823 | + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | |
820 | 824 | |
821 | 825 | if (!sta) |
822 | 826 | return RX_CONTINUE; |
... | ... | @@ -847,8 +851,8 @@ |
847 | 851 | |
848 | 852 | sta->rx_fragments++; |
849 | 853 | sta->rx_bytes += rx->skb->len; |
850 | - sta->last_signal = rx->status->signal; | |
851 | - sta->last_noise = rx->status->noise; | |
854 | + sta->last_signal = status->signal; | |
855 | + sta->last_noise = status->noise; | |
852 | 856 | |
853 | 857 | /* |
854 | 858 | * Change STA power saving mode only at the end of a frame |
855 | 859 | |
... | ... | @@ -1140,11 +1144,14 @@ |
1140 | 1144 | static int |
1141 | 1145 | ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc) |
1142 | 1146 | { |
1147 | + struct sk_buff *skb = rx->skb; | |
1148 | + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | |
1149 | + | |
1143 | 1150 | /* |
1144 | 1151 | * Pass through unencrypted frames if the hardware has |
1145 | 1152 | * decrypted them already. |
1146 | 1153 | */ |
1147 | - if (rx->status->flag & RX_FLAG_DECRYPTED) | |
1154 | + if (status->flag & RX_FLAG_DECRYPTED) | |
1148 | 1155 | return 0; |
1149 | 1156 | |
1150 | 1157 | /* Drop unencrypted frames if key is set. */ |
... | ... | @@ -1178,8 +1185,8 @@ |
1178 | 1185 | static int |
1179 | 1186 | __ieee80211_data_to_8023(struct ieee80211_rx_data *rx) |
1180 | 1187 | { |
1181 | - struct net_device *dev = rx->dev; | |
1182 | - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | |
1188 | + struct ieee80211_sub_if_data *sdata = rx->sdata; | |
1189 | + struct net_device *dev = sdata->dev; | |
1183 | 1190 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; |
1184 | 1191 | |
1185 | 1192 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN && !sdata->use_4addr && |
... | ... | @@ -1205,7 +1212,7 @@ |
1205 | 1212 | * of whether the frame was encrypted or not. |
1206 | 1213 | */ |
1207 | 1214 | if (ehdr->h_proto == htons(ETH_P_PAE) && |
1208 | - (compare_ether_addr(ehdr->h_dest, rx->dev->dev_addr) == 0 || | |
1215 | + (compare_ether_addr(ehdr->h_dest, rx->sdata->dev->dev_addr) == 0 || | |
1209 | 1216 | compare_ether_addr(ehdr->h_dest, pae_group_addr) == 0)) |
1210 | 1217 | return true; |
1211 | 1218 | |
1212 | 1219 | |
... | ... | @@ -1222,10 +1229,10 @@ |
1222 | 1229 | static void |
1223 | 1230 | ieee80211_deliver_skb(struct ieee80211_rx_data *rx) |
1224 | 1231 | { |
1225 | - struct net_device *dev = rx->dev; | |
1232 | + struct ieee80211_sub_if_data *sdata = rx->sdata; | |
1233 | + struct net_device *dev = sdata->dev; | |
1226 | 1234 | struct ieee80211_local *local = rx->local; |
1227 | 1235 | struct sk_buff *skb, *xmit_skb; |
1228 | - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | |
1229 | 1236 | struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; |
1230 | 1237 | struct sta_info *dsta; |
1231 | 1238 | |
... | ... | @@ -1306,7 +1313,7 @@ |
1306 | 1313 | static ieee80211_rx_result debug_noinline |
1307 | 1314 | ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx) |
1308 | 1315 | { |
1309 | - struct net_device *dev = rx->dev; | |
1316 | + struct net_device *dev = rx->sdata->dev; | |
1310 | 1317 | struct ieee80211_local *local = rx->local; |
1311 | 1318 | u16 ethertype; |
1312 | 1319 | u8 *payload; |
1313 | 1320 | |
... | ... | @@ -1431,12 +1438,11 @@ |
1431 | 1438 | unsigned int hdrlen; |
1432 | 1439 | struct sk_buff *skb = rx->skb, *fwd_skb; |
1433 | 1440 | struct ieee80211_local *local = rx->local; |
1434 | - struct ieee80211_sub_if_data *sdata; | |
1441 | + struct ieee80211_sub_if_data *sdata = rx->sdata; | |
1435 | 1442 | |
1436 | 1443 | hdr = (struct ieee80211_hdr *) skb->data; |
1437 | 1444 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
1438 | 1445 | mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen); |
1439 | - sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); | |
1440 | 1446 | |
1441 | 1447 | if (!ieee80211_is_data(hdr->frame_control)) |
1442 | 1448 | return RX_CONTINUE; |
... | ... | @@ -1474,7 +1480,7 @@ |
1474 | 1480 | |
1475 | 1481 | /* Frame has reached destination. Don't forward */ |
1476 | 1482 | if (!is_multicast_ether_addr(hdr->addr1) && |
1477 | - compare_ether_addr(rx->dev->dev_addr, hdr->addr3) == 0) | |
1483 | + compare_ether_addr(sdata->dev->dev_addr, hdr->addr3) == 0) | |
1478 | 1484 | return RX_CONTINUE; |
1479 | 1485 | |
1480 | 1486 | mesh_hdr->ttl--; |
1481 | 1487 | |
... | ... | @@ -1491,10 +1497,10 @@ |
1491 | 1497 | |
1492 | 1498 | if (!fwd_skb && net_ratelimit()) |
1493 | 1499 | printk(KERN_DEBUG "%s: failed to clone mesh frame\n", |
1494 | - rx->dev->name); | |
1500 | + sdata->dev->name); | |
1495 | 1501 | |
1496 | 1502 | fwd_hdr = (struct ieee80211_hdr *) fwd_skb->data; |
1497 | - memcpy(fwd_hdr->addr2, rx->dev->dev_addr, ETH_ALEN); | |
1503 | + memcpy(fwd_hdr->addr2, sdata->dev->dev_addr, ETH_ALEN); | |
1498 | 1504 | info = IEEE80211_SKB_CB(fwd_skb); |
1499 | 1505 | memset(info, 0, sizeof(*info)); |
1500 | 1506 | info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; |
... | ... | @@ -1528,7 +1534,7 @@ |
1528 | 1534 | } |
1529 | 1535 | |
1530 | 1536 | if (is_multicast_ether_addr(hdr->addr1) || |
1531 | - rx->dev->flags & IFF_PROMISC) | |
1537 | + sdata->dev->flags & IFF_PROMISC) | |
1532 | 1538 | return RX_CONTINUE; |
1533 | 1539 | else |
1534 | 1540 | return RX_DROP_MONITOR; |
1535 | 1541 | |
... | ... | @@ -1538,9 +1544,9 @@ |
1538 | 1544 | static ieee80211_rx_result debug_noinline |
1539 | 1545 | ieee80211_rx_h_data(struct ieee80211_rx_data *rx) |
1540 | 1546 | { |
1541 | - struct net_device *dev = rx->dev; | |
1547 | + struct ieee80211_sub_if_data *sdata = rx->sdata; | |
1548 | + struct net_device *dev = sdata->dev; | |
1542 | 1549 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; |
1543 | - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | |
1544 | 1550 | __le16 fc = hdr->frame_control; |
1545 | 1551 | int err; |
1546 | 1552 | |
... | ... | @@ -1664,7 +1670,7 @@ |
1664 | 1670 | ieee80211_rx_h_action(struct ieee80211_rx_data *rx) |
1665 | 1671 | { |
1666 | 1672 | struct ieee80211_local *local = rx->local; |
1667 | - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); | |
1673 | + struct ieee80211_sub_if_data *sdata = rx->sdata; | |
1668 | 1674 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; |
1669 | 1675 | int len = rx->skb->len; |
1670 | 1676 | |
... | ... | @@ -1776,7 +1782,7 @@ |
1776 | 1782 | static ieee80211_rx_result debug_noinline |
1777 | 1783 | ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) |
1778 | 1784 | { |
1779 | - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); | |
1785 | + struct ieee80211_sub_if_data *sdata = rx->sdata; | |
1780 | 1786 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; |
1781 | 1787 | |
1782 | 1788 | if (!(rx->flags & IEEE80211_RX_RA_MATCH)) |
... | ... | @@ -1852,7 +1858,7 @@ |
1852 | 1858 | } __attribute__ ((packed)) *rthdr; |
1853 | 1859 | struct sk_buff *skb = rx->skb, *skb2; |
1854 | 1860 | struct net_device *prev_dev = NULL; |
1855 | - struct ieee80211_rx_status *status = rx->status; | |
1861 | + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | |
1856 | 1862 | |
1857 | 1863 | if (rx->flags & IEEE80211_RX_CMNTR_REPORTED) |
1858 | 1864 | goto out_free_skb; |
... | ... | @@ -1928,7 +1934,6 @@ |
1928 | 1934 | |
1929 | 1935 | rx->skb = skb; |
1930 | 1936 | rx->sdata = sdata; |
1931 | - rx->dev = sdata->dev; | |
1932 | 1937 | |
1933 | 1938 | #define CALL_RXH(rxh) \ |
1934 | 1939 | do { \ |
... | ... | @@ -1987,7 +1992,9 @@ |
1987 | 1992 | struct ieee80211_rx_data *rx, |
1988 | 1993 | struct ieee80211_hdr *hdr) |
1989 | 1994 | { |
1990 | - u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len, sdata->vif.type); | |
1995 | + struct sk_buff *skb = rx->skb; | |
1996 | + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | |
1997 | + u8 *bssid = ieee80211_get_bssid(hdr, skb->len, sdata->vif.type); | |
1991 | 1998 | int multicast = is_multicast_ether_addr(hdr->addr1); |
1992 | 1999 | |
1993 | 2000 | switch (sdata->vif.type) { |
1994 | 2001 | |
... | ... | @@ -2019,10 +2026,10 @@ |
2019 | 2026 | rx->flags &= ~IEEE80211_RX_RA_MATCH; |
2020 | 2027 | } else if (!rx->sta) { |
2021 | 2028 | int rate_idx; |
2022 | - if (rx->status->flag & RX_FLAG_HT) | |
2029 | + if (status->flag & RX_FLAG_HT) | |
2023 | 2030 | rate_idx = 0; /* TODO: HT rates */ |
2024 | 2031 | else |
2025 | - rate_idx = rx->status->rate_idx; | |
2032 | + rate_idx = status->rate_idx; | |
2026 | 2033 | rx->sta = ieee80211_ibss_add_sta(sdata, bssid, hdr->addr2, |
2027 | 2034 | BIT(rate_idx)); |
2028 | 2035 | } |
... | ... | @@ -2088,7 +2095,6 @@ |
2088 | 2095 | memset(&rx, 0, sizeof(rx)); |
2089 | 2096 | rx.skb = skb; |
2090 | 2097 | rx.local = local; |
2091 | - rx.status = status; | |
2092 | 2098 | rx.rate = rate; |
2093 | 2099 | |
2094 | 2100 | if (ieee80211_is_data(hdr->frame_control) || ieee80211_is_mgmt(hdr->frame_control)) |
2095 | 2101 | |
... | ... | @@ -2102,10 +2108,8 @@ |
2102 | 2108 | ieee80211_verify_alignment(&rx); |
2103 | 2109 | |
2104 | 2110 | rx.sta = sta_info_get(local, hdr->addr2); |
2105 | - if (rx.sta) { | |
2111 | + if (rx.sta) | |
2106 | 2112 | rx.sdata = rx.sta->sdata; |
2107 | - rx.dev = rx.sta->sdata->dev; | |
2108 | - } | |
2109 | 2113 | |
2110 | 2114 | if (rx.sdata && ieee80211_is_data(hdr->frame_control)) { |
2111 | 2115 | rx.flags |= IEEE80211_RX_RA_MATCH; |
net/mac80211/wep.c
... | ... | @@ -281,16 +281,18 @@ |
281 | 281 | ieee80211_rx_result |
282 | 282 | ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx) |
283 | 283 | { |
284 | - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; | |
284 | + struct sk_buff *skb = rx->skb; | |
285 | + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | |
286 | + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | |
285 | 287 | |
286 | 288 | if (!ieee80211_is_data(hdr->frame_control) && |
287 | 289 | !ieee80211_is_auth(hdr->frame_control)) |
288 | 290 | return RX_CONTINUE; |
289 | 291 | |
290 | - if (!(rx->status->flag & RX_FLAG_DECRYPTED)) { | |
292 | + if (!(status->flag & RX_FLAG_DECRYPTED)) { | |
291 | 293 | if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) |
292 | 294 | return RX_DROP_UNUSABLE; |
293 | - } else if (!(rx->status->flag & RX_FLAG_IV_STRIPPED)) { | |
295 | + } else if (!(status->flag & RX_FLAG_IV_STRIPPED)) { | |
294 | 296 | ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key); |
295 | 297 | /* remove ICV */ |
296 | 298 | skb_trim(rx->skb, rx->skb->len - WEP_ICV_LEN); |
net/mac80211/wpa.c
... | ... | @@ -85,16 +85,16 @@ |
85 | 85 | u8 *data, *key = NULL, key_offset; |
86 | 86 | size_t data_len; |
87 | 87 | unsigned int hdrlen; |
88 | - struct ieee80211_hdr *hdr; | |
89 | 88 | u8 mic[MICHAEL_MIC_LEN]; |
90 | 89 | struct sk_buff *skb = rx->skb; |
90 | + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | |
91 | + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | |
91 | 92 | int authenticator = 1, wpa_test = 0; |
92 | 93 | |
93 | 94 | /* No way to verify the MIC if the hardware stripped it */ |
94 | - if (rx->status->flag & RX_FLAG_MMIC_STRIPPED) | |
95 | + if (status->flag & RX_FLAG_MMIC_STRIPPED) | |
95 | 96 | return RX_CONTINUE; |
96 | 97 | |
97 | - hdr = (struct ieee80211_hdr *)skb->data; | |
98 | 98 | if (!rx->key || rx->key->conf.alg != ALG_TKIP || |
99 | 99 | !ieee80211_has_protected(hdr->frame_control) || |
100 | 100 | !ieee80211_is_data_present(hdr->frame_control)) |
... | ... | @@ -216,6 +216,7 @@ |
216 | 216 | int hdrlen, res, hwaccel = 0, wpa_test = 0; |
217 | 217 | struct ieee80211_key *key = rx->key; |
218 | 218 | struct sk_buff *skb = rx->skb; |
219 | + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | |
219 | 220 | |
220 | 221 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
221 | 222 | |
... | ... | @@ -225,8 +226,8 @@ |
225 | 226 | if (!rx->sta || skb->len - hdrlen < 12) |
226 | 227 | return RX_DROP_UNUSABLE; |
227 | 228 | |
228 | - if (rx->status->flag & RX_FLAG_DECRYPTED) { | |
229 | - if (rx->status->flag & RX_FLAG_IV_STRIPPED) { | |
229 | + if (status->flag & RX_FLAG_DECRYPTED) { | |
230 | + if (status->flag & RX_FLAG_IV_STRIPPED) { | |
230 | 231 | /* |
231 | 232 | * Hardware took care of all processing, including |
232 | 233 | * replay protection, and stripped the ICV/IV so |
... | ... | @@ -442,6 +443,7 @@ |
442 | 443 | int hdrlen; |
443 | 444 | struct ieee80211_key *key = rx->key; |
444 | 445 | struct sk_buff *skb = rx->skb; |
446 | + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | |
445 | 447 | u8 pn[CCMP_PN_LEN]; |
446 | 448 | int data_len; |
447 | 449 | |
... | ... | @@ -455,8 +457,8 @@ |
455 | 457 | if (!rx->sta || data_len < 0) |
456 | 458 | return RX_DROP_UNUSABLE; |
457 | 459 | |
458 | - if ((rx->status->flag & RX_FLAG_DECRYPTED) && | |
459 | - (rx->status->flag & RX_FLAG_IV_STRIPPED)) | |
460 | + if ((status->flag & RX_FLAG_DECRYPTED) && | |
461 | + (status->flag & RX_FLAG_IV_STRIPPED)) | |
460 | 462 | return RX_CONTINUE; |
461 | 463 | |
462 | 464 | ccmp_hdr2pn(pn, skb->data + hdrlen); |
... | ... | @@ -466,7 +468,7 @@ |
466 | 468 | return RX_DROP_UNUSABLE; |
467 | 469 | } |
468 | 470 | |
469 | - if (!(rx->status->flag & RX_FLAG_DECRYPTED)) { | |
471 | + if (!(status->flag & RX_FLAG_DECRYPTED)) { | |
470 | 472 | /* hardware didn't decrypt/verify MIC */ |
471 | 473 | ccmp_special_blocks(skb, pn, key->u.ccmp.rx_crypto_buf, 1); |
472 | 474 | |
... | ... | @@ -563,6 +565,7 @@ |
563 | 565 | ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx) |
564 | 566 | { |
565 | 567 | struct sk_buff *skb = rx->skb; |
568 | + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | |
566 | 569 | struct ieee80211_key *key = rx->key; |
567 | 570 | struct ieee80211_mmie *mmie; |
568 | 571 | u8 aad[20], mic[8], ipn[6]; |
... | ... | @@ -571,8 +574,8 @@ |
571 | 574 | if (!ieee80211_is_mgmt(hdr->frame_control)) |
572 | 575 | return RX_CONTINUE; |
573 | 576 | |
574 | - if ((rx->status->flag & RX_FLAG_DECRYPTED) && | |
575 | - (rx->status->flag & RX_FLAG_IV_STRIPPED)) | |
577 | + if ((status->flag & RX_FLAG_DECRYPTED) && | |
578 | + (status->flag & RX_FLAG_IV_STRIPPED)) | |
576 | 579 | return RX_CONTINUE; |
577 | 580 | |
578 | 581 | if (skb->len < 24 + sizeof(*mmie)) |
... | ... | @@ -591,7 +594,7 @@ |
591 | 594 | return RX_DROP_UNUSABLE; |
592 | 595 | } |
593 | 596 | |
594 | - if (!(rx->status->flag & RX_FLAG_DECRYPTED)) { | |
597 | + if (!(status->flag & RX_FLAG_DECRYPTED)) { | |
595 | 598 | /* hardware didn't decrypt/verify MIC */ |
596 | 599 | bip_aad(skb, aad); |
597 | 600 | ieee80211_aes_cmac(key->u.aes_cmac.tfm, |