@@ -2762,7 +2762,8 @@ static void ieee80211_auth_challenge(struct ieee80211_sub_if_data *sdata,
27622762 u32 tx_flags = 0 ;
27632763
27642764 pos = mgmt -> u .auth .variable ;
2765- ieee802_11_parse_elems (pos , len - (pos - (u8 * ) mgmt ), false, & elems );
2765+ ieee802_11_parse_elems (pos , len - (pos - (u8 * )mgmt ), false, & elems ,
2766+ mgmt -> bssid , auth_data -> bss -> bssid );
27662767 if (!elems .challenge )
27672768 return ;
27682769 auth_data -> expected_transaction = 4 ;
@@ -3130,7 +3131,8 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
31303131 }
31313132
31323133 pos = mgmt -> u .assoc_resp .variable ;
3133- ieee802_11_parse_elems (pos , len - (pos - (u8 * ) mgmt ), false, & elems );
3134+ ieee802_11_parse_elems (pos , len - (pos - (u8 * )mgmt ), false, & elems ,
3135+ mgmt -> bssid , assoc_data -> bss -> bssid );
31343136
31353137 if (!elems .supp_rates ) {
31363138 sdata_info (sdata , "no SuppRates element in AssocResp\n" );
@@ -3167,7 +3169,9 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
31673169 return false;
31683170
31693171 ieee802_11_parse_elems (bss_ies -> data , bss_ies -> len ,
3170- false, & bss_elems );
3172+ false, & bss_elems ,
3173+ mgmt -> bssid ,
3174+ assoc_data -> bss -> bssid );
31713175 if (assoc_data -> wmm &&
31723176 !elems .wmm_param && bss_elems .wmm_param ) {
31733177 elems .wmm_param = bss_elems .wmm_param ;
@@ -3464,7 +3468,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
34643468 return ;
34653469
34663470 pos = mgmt -> u .assoc_resp .variable ;
3467- ieee802_11_parse_elems (pos , len - (pos - (u8 * ) mgmt ), false, & elems );
3471+ ieee802_11_parse_elems (pos , len - (pos - (u8 * )mgmt ), false, & elems ,
3472+ mgmt -> bssid , assoc_data -> bss -> bssid );
34683473
34693474 if (status_code == WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY &&
34703475 elems .timeout_int &&
@@ -3521,8 +3526,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
35213526
35223527static void ieee80211_rx_bss_info (struct ieee80211_sub_if_data * sdata ,
35233528 struct ieee80211_mgmt * mgmt , size_t len ,
3524- struct ieee80211_rx_status * rx_status ,
3525- struct ieee802_11_elems * elems )
3529+ struct ieee80211_rx_status * rx_status )
35263530{
35273531 struct ieee80211_local * local = sdata -> local ;
35283532 struct ieee80211_bss * bss ;
@@ -3534,8 +3538,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
35343538 if (!channel )
35353539 return ;
35363540
3537- bss = ieee80211_bss_info_update (local , rx_status , mgmt , len , elems ,
3538- channel );
3541+ bss = ieee80211_bss_info_update (local , rx_status , mgmt , len , channel );
35393542 if (bss ) {
35403543 sdata -> vif .bss_conf .beacon_rate = bss -> beacon_rate ;
35413544 ieee80211_rx_bss_put (local , bss );
@@ -3550,7 +3553,6 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata,
35503553 struct ieee80211_if_managed * ifmgd ;
35513554 struct ieee80211_rx_status * rx_status = (void * ) skb -> cb ;
35523555 size_t baselen , len = skb -> len ;
3553- struct ieee802_11_elems elems ;
35543556
35553557 ifmgd = & sdata -> u .mgd ;
35563558
@@ -3563,10 +3565,7 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata,
35633565 if (baselen > len )
35643566 return ;
35653567
3566- ieee802_11_parse_elems (mgmt -> u .probe_resp .variable , len - baselen ,
3567- false, & elems );
3568-
3569- ieee80211_rx_bss_info (sdata , mgmt , len , rx_status , & elems );
3568+ ieee80211_rx_bss_info (sdata , mgmt , len , rx_status );
35703569
35713570 if (ifmgd -> associated &&
35723571 ether_addr_equal (mgmt -> bssid , ifmgd -> associated -> bssid ))
@@ -3736,9 +3735,11 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
37363735 if (ifmgd -> assoc_data && ifmgd -> assoc_data -> need_beacon &&
37373736 ether_addr_equal (mgmt -> bssid , ifmgd -> assoc_data -> bss -> bssid )) {
37383737 ieee802_11_parse_elems (mgmt -> u .beacon .variable ,
3739- len - baselen , false, & elems );
3738+ len - baselen , false, & elems ,
3739+ mgmt -> bssid ,
3740+ ifmgd -> assoc_data -> bss -> bssid );
37403741
3741- ieee80211_rx_bss_info (sdata , mgmt , len , rx_status , & elems );
3742+ ieee80211_rx_bss_info (sdata , mgmt , len , rx_status );
37423743 if (elems .tim && !elems .parse_error ) {
37433744 const struct ieee80211_tim_ie * tim_ie = elems .tim ;
37443745 ifmgd -> dtim_period = tim_ie -> dtim_period ;
@@ -3787,7 +3788,8 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
37873788 ncrc = crc32_be (0 , (void * )& mgmt -> u .beacon .beacon_int , 4 );
37883789 ncrc = ieee802_11_parse_elems_crc (mgmt -> u .beacon .variable ,
37893790 len - baselen , false, & elems ,
3790- care_about_ies , ncrc );
3791+ care_about_ies , ncrc ,
3792+ mgmt -> bssid , bssid );
37913793
37923794 if (ieee80211_hw_check (& local -> hw , PS_NULLFUNC_STACK ) &&
37933795 ieee80211_check_tim (elems .tim , elems .tim_len , ifmgd -> aid )) {
@@ -3871,7 +3873,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
38713873 ifmgd -> beacon_crc = ncrc ;
38723874 ifmgd -> beacon_crc_valid = true;
38733875
3874- ieee80211_rx_bss_info (sdata , mgmt , len , rx_status , & elems );
3876+ ieee80211_rx_bss_info (sdata , mgmt , len , rx_status );
38753877
38763878 ieee80211_sta_process_chanswitch (sdata , rx_status -> mactime ,
38773879 rx_status -> device_timestamp ,
@@ -3992,9 +3994,10 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
39923994 if (ies_len < 0 )
39933995 break ;
39943996
3997+ /* CSA IE cannot be overridden, no need for BSSID */
39953998 ieee802_11_parse_elems (
39963999 mgmt -> u .action .u .chan_switch .variable ,
3997- ies_len , true, & elems );
4000+ ies_len , true, & elems , mgmt -> bssid , NULL );
39984001
39994002 if (elems .parse_error )
40004003 break ;
@@ -4011,9 +4014,13 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
40114014 if (ies_len < 0 )
40124015 break ;
40134016
4017+ /*
4018+ * extended CSA IE can't be overridden, no need for
4019+ * BSSID
4020+ */
40144021 ieee802_11_parse_elems (
40154022 mgmt -> u .action .u .ext_chan_switch .variable ,
4016- ies_len , true, & elems );
4023+ ies_len , true, & elems , mgmt -> bssid , NULL );
40174024
40184025 if (elems .parse_error )
40194026 break ;
0 commit comments