Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-wpa_supplicant_8: 提交

external/wpa_supplicant_8


Commit MetaInfo

修订版a7c60b4c03ced564d424e4cae81b85f7112aa59b (tree)
时间2014-12-04 08:51:11
作者Jithu Jance <jithu@broa...>
Commitervandwalle

Log Message

nl80211: Ignore Connect failure for the previous association

Suppose there are two APs (AP1 & AP2) and user attempted to connect to
AP2 before the previous connection with AP1 could succeed. Now, if the
connection event comes for the older AP with failed status, we should
just ignore it as the wpa_supplicant state has moved to "ASSOCIATING"
with the new AP (AP2).

This is a similar to the case where a disconnection event is ignored for
a case where local disconnect request can cause the extra event to show
up during the next association process following that command.

Signed-off-by: Jithu Jance <jithu@broadcom.com>
Signed-off-by: vandwalle <vandwalle@google.com>

更改概述

差异

--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1591,6 +1591,7 @@ static void mlme_event_connect(struct wpa_driver_nl80211_data *drv,
15911591 struct nlattr *resp_ie)
15921592 {
15931593 union wpa_event_data event;
1594+ u16 status_code;
15941595
15951596 if (drv->capa.flags & WPA_DRIVER_FLAGS_SME) {
15961597 /*
@@ -1602,21 +1603,41 @@ static void mlme_event_connect(struct wpa_driver_nl80211_data *drv,
16021603 return;
16031604 }
16041605
1605- if (cmd == NL80211_CMD_CONNECT)
1606- wpa_printf(MSG_DEBUG, "nl80211: Connect event");
1607- else if (cmd == NL80211_CMD_ROAM)
1606+ status_code = status ? nla_get_u16(status) : WLAN_STATUS_SUCCESS;
1607+
1608+ if (cmd == NL80211_CMD_CONNECT) {
1609+ wpa_printf(MSG_DEBUG,
1610+ "nl80211: Connect event (status=%u ignore_next_local_disconnect=%d)",
1611+ status_code, drv->ignore_next_local_disconnect);
1612+ } else if (cmd == NL80211_CMD_ROAM) {
16081613 wpa_printf(MSG_DEBUG, "nl80211: Roam event");
1614+ }
16091615
16101616 os_memset(&event, 0, sizeof(event));
1611- if (cmd == NL80211_CMD_CONNECT &&
1612- nla_get_u16(status) != WLAN_STATUS_SUCCESS) {
1617+ if (cmd == NL80211_CMD_CONNECT && status_code != WLAN_STATUS_SUCCESS) {
16131618 if (addr)
16141619 event.assoc_reject.bssid = nla_data(addr);
1620+ if (drv->ignore_next_local_disconnect) {
1621+ drv->ignore_next_local_disconnect = 0;
1622+ if (!event.assoc_reject.bssid ||
1623+ (os_memcmp(event.assoc_reject.bssid,
1624+ drv->auth_attempt_bssid,
1625+ ETH_ALEN) != 0)) {
1626+ /*
1627+ * Ignore the event that came without a BSSID or
1628+ * for the old connection since this is likely
1629+ * not relevant to the new Connect command.
1630+ */
1631+ wpa_printf(MSG_DEBUG,
1632+ "nl80211: Ignore connection failure event triggered during reassociation");
1633+ return;
1634+ }
1635+ }
16151636 if (resp_ie) {
16161637 event.assoc_reject.resp_ies = nla_data(resp_ie);
16171638 event.assoc_reject.resp_ies_len = nla_len(resp_ie);
16181639 }
1619- event.assoc_reject.status_code = nla_get_u16(status);
1640+ event.assoc_reject.status_code = status_code;
16201641 wpa_supplicant_event(drv->ctx, EVENT_ASSOC_REJECT, &event);
16211642 return;
16221643 }
@@ -9086,7 +9107,15 @@ static int wpa_driver_nl80211_connect(
90869107 struct wpa_driver_nl80211_data *drv,
90879108 struct wpa_driver_associate_params *params)
90889109 {
9089- int ret = wpa_driver_nl80211_try_connect(drv, params);
9110+ int ret;
9111+
9112+ /* Store the connection attempted bssid for future use */
9113+ if (params->bssid)
9114+ os_memcpy(drv->auth_attempt_bssid, params->bssid, ETH_ALEN);
9115+ else
9116+ os_memset(drv->auth_attempt_bssid, 0, ETH_ALEN);
9117+
9118+ ret = wpa_driver_nl80211_try_connect(drv, params);
90909119 if (ret == -EALREADY) {
90919120 /*
90929121 * cfg80211 does not currently accept new connections if
Show on old repository browser