mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +01:00
p2p: Fix parsing of Association Req P2P IEs
p2p_parse_association_req() already extracts the P2P IE payload from the IE sequence, there's no need to call ie_tlv_extract_p2p_payload before it. Pass the IE sequence directly to p2p_parse_association_req().
This commit is contained in:
parent
1399b5688b
commit
42afc31cbe
15
src/p2p.c
15
src/p2p.c
@ -898,22 +898,11 @@ static void p2p_group_event(enum ap_event_type type, const void *event_data,
|
||||
case AP_EVENT_STATION_ADDED:
|
||||
{
|
||||
const struct ap_event_station_added_data *data = event_data;
|
||||
L_AUTO_FREE_VAR(uint8_t *, p2p_data) = NULL;
|
||||
ssize_t p2p_data_len;
|
||||
L_AUTO_FREE_VAR(uint8_t *, wfd_data) = NULL;
|
||||
ssize_t wfd_data_len;
|
||||
struct p2p_association_req req_info;
|
||||
int r;
|
||||
|
||||
p2p_data = ie_tlv_extract_p2p_payload(data->assoc_ies,
|
||||
data->assoc_ies_len,
|
||||
&p2p_data_len);
|
||||
if (!p2p_data) {
|
||||
l_error("Missing or invalid P2P IEs: %s (%i)",
|
||||
strerror(-p2p_data_len), (int) -p2p_data_len);
|
||||
goto invalid_ie;
|
||||
}
|
||||
|
||||
/*
|
||||
* We don't need to validate most of the Association Request
|
||||
* P2P IE contents as we already have all the information there
|
||||
@ -928,8 +917,8 @@ static void p2p_group_event(enum ap_event_type type, const void *event_data,
|
||||
* information shall be used by the P2P Group Owner for Group
|
||||
* Information Advertisement.
|
||||
*/
|
||||
r = p2p_parse_association_req(p2p_data, p2p_data_len,
|
||||
&req_info);
|
||||
r = p2p_parse_association_req(data->assoc_ies,
|
||||
data->assoc_ies_len, &req_info);
|
||||
if (r < 0) {
|
||||
l_error("Can't parse P2P Association Request: %s (%i)",
|
||||
strerror(-r), -r);
|
||||
|
Loading…
Reference in New Issue
Block a user