mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-25 17:59:25 +01:00
ap: Pass frame IEs from clients to the ap_state user
Pass the string IEs from the incoming STA association frames to the user in the AP event data. I drop ap_event_station_added_data.rsn_ie because that probably wasn't going to ever be useful and the RSN IE is included in the .assoc_ies array in any case.
This commit is contained in:
parent
71ba94121d
commit
c19fd0ee78
22
src/ap.c
22
src/ap.c
@ -99,6 +99,8 @@ struct sta_state {
|
|||||||
struct l_uintset *rates;
|
struct l_uintset *rates;
|
||||||
uint32_t assoc_resp_cmd_id;
|
uint32_t assoc_resp_cmd_id;
|
||||||
struct ap_state *ap;
|
struct ap_state *ap;
|
||||||
|
uint8_t *assoc_ies;
|
||||||
|
size_t assoc_ies_len;
|
||||||
uint8_t *assoc_rsne;
|
uint8_t *assoc_rsne;
|
||||||
struct eapol_sm *sm;
|
struct eapol_sm *sm;
|
||||||
struct handshake_state *hs;
|
struct handshake_state *hs;
|
||||||
@ -279,7 +281,7 @@ static void ap_sta_free(void *data)
|
|||||||
struct ap_state *ap = sta->ap;
|
struct ap_state *ap = sta->ap;
|
||||||
|
|
||||||
l_uintset_free(sta->rates);
|
l_uintset_free(sta->rates);
|
||||||
l_free(sta->assoc_rsne);
|
l_free(sta->assoc_ies);
|
||||||
|
|
||||||
if (sta->assoc_resp_cmd_id)
|
if (sta->assoc_resp_cmd_id)
|
||||||
l_genl_family_cancel(ap->nl80211, sta->assoc_resp_cmd_id);
|
l_genl_family_cancel(ap->nl80211, sta->assoc_resp_cmd_id);
|
||||||
@ -411,7 +413,8 @@ static void ap_new_rsna(struct sta_state *sta)
|
|||||||
if (ap->ops->handle_event) {
|
if (ap->ops->handle_event) {
|
||||||
struct ap_event_station_added_data event_data = {};
|
struct ap_event_station_added_data event_data = {};
|
||||||
event_data.mac = sta->addr;
|
event_data.mac = sta->addr;
|
||||||
event_data.rsn_ie = sta->assoc_rsne;
|
event_data.assoc_ies = sta->assoc_ies;
|
||||||
|
event_data.assoc_ies_len = sta->assoc_ies_len;
|
||||||
ap->ops->handle_event(AP_EVENT_STATION_ADDED, &event_data,
|
ap->ops->handle_event(AP_EVENT_STATION_ADDED, &event_data,
|
||||||
ap->user_data);
|
ap->user_data);
|
||||||
}
|
}
|
||||||
@ -1474,6 +1477,8 @@ static void ap_assoc_reassoc(struct sta_state *sta, bool reassoc,
|
|||||||
sta->wsc_v2 = wsc_req.version2;
|
sta->wsc_v2 = wsc_req.version2;
|
||||||
|
|
||||||
event_data.mac = sta->addr;
|
event_data.mac = sta->addr;
|
||||||
|
event_data.assoc_ies = ies;
|
||||||
|
event_data.assoc_ies_len = ies_len;
|
||||||
ap->ops->handle_event(AP_EVENT_REGISTRATION_START, &event_data,
|
ap->ops->handle_event(AP_EVENT_REGISTRATION_START, &event_data,
|
||||||
ap->user_data);
|
ap->user_data);
|
||||||
|
|
||||||
@ -1524,13 +1529,16 @@ static void ap_assoc_reassoc(struct sta_state *sta, bool reassoc,
|
|||||||
|
|
||||||
sta->rates = rates;
|
sta->rates = rates;
|
||||||
|
|
||||||
if (sta->assoc_rsne)
|
l_free(sta->assoc_ies);
|
||||||
l_free(sta->assoc_rsne);
|
|
||||||
|
|
||||||
if (rsn)
|
if (rsn) {
|
||||||
sta->assoc_rsne = l_memdup(rsn, rsn[1] + 2);
|
sta->assoc_ies = l_memdup(ies, ies_len);
|
||||||
else
|
sta->assoc_ies_len = ies_len;
|
||||||
|
sta->assoc_rsne = sta->assoc_ies + (rsn - ies);
|
||||||
|
} else {
|
||||||
|
sta->assoc_ies = NULL;
|
||||||
sta->assoc_rsne = NULL;
|
sta->assoc_rsne = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
sta->assoc_resp_cmd_id = ap_assoc_resp(ap, sta, sta->addr, 0, reassoc,
|
sta->assoc_resp_cmd_id = ap_assoc_resp(ap, sta, sta->addr, 0, reassoc,
|
||||||
ap_success_assoc_resp_cb);
|
ap_success_assoc_resp_cb);
|
||||||
|
5
src/ap.h
5
src/ap.h
@ -36,7 +36,8 @@ enum ap_event_type {
|
|||||||
|
|
||||||
struct ap_event_station_added_data {
|
struct ap_event_station_added_data {
|
||||||
const uint8_t *mac;
|
const uint8_t *mac;
|
||||||
const uint8_t *rsn_ie;
|
const uint8_t *assoc_ies;
|
||||||
|
size_t assoc_ies_len;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ap_event_station_removed_data {
|
struct ap_event_station_removed_data {
|
||||||
@ -46,6 +47,8 @@ struct ap_event_station_removed_data {
|
|||||||
|
|
||||||
struct ap_event_registration_start_data {
|
struct ap_event_registration_start_data {
|
||||||
const uint8_t *mac;
|
const uint8_t *mac;
|
||||||
|
const uint8_t *assoc_ies;
|
||||||
|
size_t assoc_ies_len;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ap_event_registration_success_data {
|
struct ap_event_registration_success_data {
|
||||||
|
Loading…
Reference in New Issue
Block a user