mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-29 08:14:02 -05:00
TDLS: Clean up add/set peer operations
Use a helper function to avoid multiple copies of the same long list of argument parameters to wpa_sm_tdls_peer_addset() from the peer entry. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
bcd2baa0fa
commit
37d8a27401
@ -1631,6 +1631,23 @@ static int copy_peer_supp_oper_classes(const struct wpa_eapol_ie_parse *kde,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int wpa_tdls_addset_peer(struct wpa_sm *sm, struct wpa_tdls_peer *peer,
|
||||||
|
int add)
|
||||||
|
{
|
||||||
|
return wpa_sm_tdls_peer_addset(sm, peer->addr, add, peer->aid,
|
||||||
|
peer->capability,
|
||||||
|
peer->supp_rates, peer->supp_rates_len,
|
||||||
|
peer->ht_capabilities,
|
||||||
|
peer->vht_capabilities,
|
||||||
|
peer->qos_info, peer->ext_capab,
|
||||||
|
peer->ext_capab_len,
|
||||||
|
peer->supp_channels,
|
||||||
|
peer->supp_channels_len,
|
||||||
|
peer->supp_oper_classes,
|
||||||
|
peer->supp_oper_classes_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
|
static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
|
||||||
const u8 *buf, size_t len)
|
const u8 *buf, size_t len)
|
||||||
{
|
{
|
||||||
@ -1945,18 +1962,8 @@ skip_rsn:
|
|||||||
wpa_tdls_generate_tpk(peer, sm->own_addr, sm->bssid);
|
wpa_tdls_generate_tpk(peer, sm->own_addr, sm->bssid);
|
||||||
|
|
||||||
skip_rsn_check:
|
skip_rsn_check:
|
||||||
/* add the peer to the driver as a "setup in progress" peer */
|
/* add supported rates, capabilities, and qos_info to the TDLS peer */
|
||||||
if (wpa_sm_tdls_peer_addset(sm, peer->addr, 1, peer->aid,
|
if (wpa_tdls_addset_peer(sm, peer, 1) < 0)
|
||||||
peer->capability,
|
|
||||||
peer->supp_rates, peer->supp_rates_len,
|
|
||||||
peer->ht_capabilities,
|
|
||||||
peer->vht_capabilities,
|
|
||||||
peer->qos_info, peer->ext_capab,
|
|
||||||
peer->ext_capab_len,
|
|
||||||
peer->supp_channels,
|
|
||||||
peer->supp_channels_len,
|
|
||||||
peer->supp_oper_classes,
|
|
||||||
peer->supp_oper_classes_len))
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
peer->tpk_in_progress = 1;
|
peer->tpk_in_progress = 1;
|
||||||
@ -2256,17 +2263,7 @@ skip_rsn:
|
|||||||
peer->dtoken = dtoken;
|
peer->dtoken = dtoken;
|
||||||
|
|
||||||
/* add supported rates, capabilities, and qos_info to the TDLS peer */
|
/* add supported rates, capabilities, and qos_info to the TDLS peer */
|
||||||
if (wpa_sm_tdls_peer_addset(sm, peer->addr, 0, peer->aid,
|
if (wpa_tdls_addset_peer(sm, peer, 0) < 0)
|
||||||
peer->capability,
|
|
||||||
peer->supp_rates, peer->supp_rates_len,
|
|
||||||
peer->ht_capabilities,
|
|
||||||
peer->vht_capabilities,
|
|
||||||
peer->qos_info, peer->ext_capab,
|
|
||||||
peer->ext_capab_len,
|
|
||||||
peer->supp_channels,
|
|
||||||
peer->supp_channels_len,
|
|
||||||
peer->supp_oper_classes,
|
|
||||||
peer->supp_oper_classes_len) < 0)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "TDLS: Sending TDLS Setup Confirm / "
|
wpa_printf(MSG_DEBUG, "TDLS: Sending TDLS Setup Confirm / "
|
||||||
@ -2435,17 +2432,7 @@ static int wpa_tdls_process_tpk_m3(struct wpa_sm *sm, const u8 *src_addr,
|
|||||||
|
|
||||||
skip_rsn:
|
skip_rsn:
|
||||||
/* add supported rates, capabilities, and qos_info to the TDLS peer */
|
/* add supported rates, capabilities, and qos_info to the TDLS peer */
|
||||||
if (wpa_sm_tdls_peer_addset(sm, peer->addr, 0, peer->aid,
|
if (wpa_tdls_addset_peer(sm, peer, 0) < 0)
|
||||||
peer->capability,
|
|
||||||
peer->supp_rates, peer->supp_rates_len,
|
|
||||||
peer->ht_capabilities,
|
|
||||||
peer->vht_capabilities,
|
|
||||||
peer->qos_info, peer->ext_capab,
|
|
||||||
peer->ext_capab_len,
|
|
||||||
peer->supp_channels,
|
|
||||||
peer->supp_channels_len,
|
|
||||||
peer->supp_oper_classes,
|
|
||||||
peer->supp_oper_classes_len) < 0)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!peer->tpk_success) {
|
if (!peer->tpk_success) {
|
||||||
|
Loading…
Reference in New Issue
Block a user