nl80211: Add NL80211_ATTR_PREV_BSSID with Connect command
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 24 Mar 2016 10:33:40 +0000 (12:33 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 24 Mar 2016 20:35:10 +0000 (22:35 +0200)
This makes it easier for drivers that use the Connect command instead of
separate Auth+Assoc commands to determine when to use reassociation
instead of association. Matching changes are still needed in cfg80211 to
allow this parameter to be used, but it is safe for wpa_supplicant to
start including this attribute now since it will be ignored by older
cfg80211 versions.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/drivers/driver_nl80211.c

index 8bd2c24..baa418b 100644 (file)
@@ -4841,6 +4841,14 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv,
                        return -1;
        }
 
+       if (params->prev_bssid) {
+               wpa_printf(MSG_DEBUG, "  * prev_bssid=" MACSTR,
+                          MAC2STR(params->prev_bssid));
+               if (nla_put(msg, NL80211_ATTR_PREV_BSSID, ETH_ALEN,
+                           params->prev_bssid))
+                       return -1;
+       }
+
        return 0;
 }
 
@@ -4993,14 +5001,6 @@ static int wpa_driver_nl80211_associate(
        if (ret)
                goto fail;
 
-       if (params->prev_bssid) {
-               wpa_printf(MSG_DEBUG, "  * prev_bssid=" MACSTR,
-                          MAC2STR(params->prev_bssid));
-               if (nla_put(msg, NL80211_ATTR_PREV_BSSID, ETH_ALEN,
-                           params->prev_bssid))
-                       goto fail;
-       }
-
        ret = send_and_recv_msgs(drv, msg, NULL, NULL);
        msg = NULL;
        if (ret) {