From: Jouni Malinen Date: Thu, 24 Mar 2016 10:33:40 +0000 (+0200) Subject: nl80211: Add NL80211_ATTR_PREV_BSSID with Connect command X-Git-Tag: hostap_2_6~682 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00c3c4ac9b00937d4878b75df5da437f1c794a70;p=thirdparty%2Fhostap.git nl80211: Add NL80211_ATTR_PREV_BSSID with Connect command 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 --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 8bd2c24f9..baa418b88 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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) {