]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: (Re)Association Request frame IEs from association event
authorJouni Malinen <jouni@codeaurora.org>
Thu, 14 Feb 2019 20:01:20 +0000 (22:01 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 15 Feb 2019 00:09:41 +0000 (02:09 +0200)
Process NL80211_ATTR_REQ_IE from the NL80211_CMD_ASSOCIATE event to
allow request IEs to be made available for the SME-in-wpa_supplicant
case similarly to how this is done with SME-in-driver with
NL80211_CMD_CONNECT.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/drivers/driver_nl80211_event.c

index 06e619b94c10035db1827db09a2a16838ee3a154..ffddd94d204ca35646df1c5c26266ac5256b9b4d 100644 (file)
@@ -206,7 +206,8 @@ static void nl80211_parse_wmm_params(struct nlattr *wmm_attr,
 
 
 static void mlme_event_assoc(struct wpa_driver_nl80211_data *drv,
-                           const u8 *frame, size_t len, struct nlattr *wmm)
+                            const u8 *frame, size_t len, struct nlattr *wmm,
+                            struct nlattr *req_ie)
 {
        const struct ieee80211_mgmt *mgmt;
        union wpa_event_data event;
@@ -261,6 +262,11 @@ static void mlme_event_assoc(struct wpa_driver_nl80211_data *drv,
                        len - 24 - sizeof(mgmt->u.assoc_resp);
        }
 
+       if (req_ie) {
+               event.assoc_info.req_ies = nla_data(req_ie);
+               event.assoc_info.req_ies_len = nla_len(req_ie);
+       }
+
        event.assoc_info.freq = drv->assoc_freq;
 
        /* When this association was initiated outside of wpa_supplicant,
@@ -868,7 +874,7 @@ static void mlme_event(struct i802_bss *bss,
                       struct nlattr *addr, struct nlattr *timed_out,
                       struct nlattr *freq, struct nlattr *ack,
                       struct nlattr *cookie, struct nlattr *sig,
-                      struct nlattr *wmm)
+                      struct nlattr *wmm, struct nlattr *req_ie)
 {
        struct wpa_driver_nl80211_data *drv = bss->drv;
        const u8 *data;
@@ -917,7 +923,8 @@ static void mlme_event(struct i802_bss *bss,
                mlme_event_auth(drv, nla_data(frame), nla_len(frame));
                break;
        case NL80211_CMD_ASSOCIATE:
-               mlme_event_assoc(drv, nla_data(frame), nla_len(frame), wmm);
+               mlme_event_assoc(drv, nla_data(frame), nla_len(frame), wmm,
+                                req_ie);
                break;
        case NL80211_CMD_DEAUTHENTICATE:
                mlme_event_deauth_disassoc(drv, EVENT_DEAUTH,
@@ -2475,7 +2482,8 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
                           tb[NL80211_ATTR_WIPHY_FREQ], tb[NL80211_ATTR_ACK],
                           tb[NL80211_ATTR_COOKIE],
                           tb[NL80211_ATTR_RX_SIGNAL_DBM],
-                          tb[NL80211_ATTR_STA_WME]);
+                          tb[NL80211_ATTR_STA_WME],
+                          tb[NL80211_ATTR_REQ_IE]);
                break;
        case NL80211_CMD_CONNECT:
        case NL80211_CMD_ROAM:
@@ -2648,7 +2656,7 @@ int process_bss_event(struct nl_msg *msg, void *arg)
                           tb[NL80211_ATTR_WIPHY_FREQ], tb[NL80211_ATTR_ACK],
                           tb[NL80211_ATTR_COOKIE],
                           tb[NL80211_ATTR_RX_SIGNAL_DBM],
-                          tb[NL80211_ATTR_STA_WME]);
+                          tb[NL80211_ATTR_STA_WME], NULL);
                break;
        case NL80211_CMD_UNEXPECTED_FRAME:
                nl80211_spurious_frame(bss, tb, 0);