aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Capability matching for 60 GHz bandVladimir Kondratiev2013-02-071-3/+24
| | | | | | | | | On the DMG (60 GHz) band, capability bits defined differently from non-DMG ones. Adjust capability matching to cover both cases. Also, for non-DMG bands, check ESS bit is set. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
* nl80211: Add ctrl_iface message for AP mode connection rejectionRaja Mani2013-02-071-0/+10
| | | | | | | | | | | | When AP mode operation reject the client, nl80211 layer advertises the connect failed event with the reason for failures (for example, max client reached, etc.) using NL80211_CMD_CONN_FAILED. This patch adds some debug messages whenever such an event is received from the nl80211 layer and also the same event is posted to the upper layer via wpa_msg(). Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
* TDLS: Remove link, if any, on an implicit set up requestSunil Dutt2013-02-051-1/+5
| | | | | | | | | | | | | | If an implicit TDLS set up request is obtained on an existing link or an to be established link, the previous link was not removed. This commit disables the existing link on a new set up request. Also, wpa_tdls_reneg() function was invoking wpa_tdls_start() on an already existing peer for the case of internal setup, which is incorrect. Thus the invocation of wpa_tdls_start() is removed in wpa_tdls_reneg() and also this function is renamed to wps_tdls_remove() as it does not renegotiation rather shall remove the link (if any) for the case of external setup. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Make wpas_select_network_from_last_scan() staticJouni Malinen2013-02-031-1/+4
| | | | | | | Addition of wpa_supplicant_fast_associate() made it unnecessary to call wpas_select_network_from_last_scan() directly from other files. Signed-hostap: Jouni Malinen <j@w1.fi>
* wpa_supplicant: Implement fast-associate on SelectNetworkPaul Stewart2013-02-031-0/+20
| | | | | | | | | | If scan results are available when we perform a SelectNetwork, use them to make an associate decision. This can save an entire scan interval-worth of time in situations where something external to wpa_supplicant (like a connection manager) has just previously requested a scan before calling SelectNetwork. Signed-hostap: Paul Stewart <pstew@chromium.org>
* TDLS: Disable the link also on driver request for teardownSunil Dutt2013-01-221-1/+1
| | | | | | | | | The link was not disabled for the case of implicit trigger from the driver unlike in the case of explicit trigger fromc ctrl_iface. Make the tear down sequences match in these cases by adding the TDLS_DISABLE_LINK tdls_oper to the driver when processing the TDLS_REQUEST_TEARDOWN event. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Add more debug info if wpa_supplicant_set_suites() failsJouni Malinen2013-01-121-2/+3
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* WNM: Fix BSS Transition Management Request processingJouni Malinen2012-12-221-48/+0
| | | | | | | | | The WNM-Sleep Mode handler took over WNM Action frame processing without addressing the previously implemented WNM handler. Fix this by moving the BSs Transition Management processing into wnm_sta.c to share a single handler function for WNM Action frames. Signed-hostap: Jouni Malinen <j@w1.fi>
* Extend EAPOL frames processing workaround for roaming casesJouni Malinen2012-12-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Commit 1ff733383f3d5c73233ef452a738765667021609 added a mechanism to work around issues due to association events and EAPOL RX events being getting reordered. However, this applied only for the case where wpa_supplicant is not in associated state. The same issue can happen in roaming case with drivers that perform BSS selection internally (or in firmware). Handle that case similarly by delaying received EAPOL frame processing if the source address of the EAPOL frame does not match the current BSSID. Since wired IEEE 802.1X do not have BSSID, make this additional workaround conditional on BSSID match having been observed during the previous association. This fixes issues where the initial EAPOL frame after reassociation was either dropped (e.g., due to replay counter not increasing) or replied to with incorrect destination address (the BSSID of the old AP). This can result in significantly more robust roaming behavior with drivers that do not use wpa_supplicant for BSS selection. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WNM: Add option to disable keep-alive frames for testing purposesJouni Malinen2012-12-181-6/+10
| | | | | | | "wpa_cli set no_keep_alive 1/0" can now be used to disable/enable keep alive frames to enable testing. Signed-hostap: Jouni Malinen <j@w1.fi>
* WNM: Use CONFIG_WNM more consistentlyJouni Malinen2012-12-161-6/+6
| | | | | | | | | | Replace CONFIG_IEEE80211V with CONFIG_WNM to get more consistent build options for WNM-Sleep Mode operations. Previously it was possible to define CONFIG_IEEE80211V without CONFIG_WNM which would break the build. In addition, IEEE 802.11v has been merged into IEEE Std 802.11-2012 and WNM is a better term to use for this new functionality anyway. Signed-hostap: Jouni Malinen <j@w1.fi>
* WNM: Add option for passing TFS request from external programsJouni Malinen2012-12-161-1/+1
| | | | | | | | The optional tfs_req=<hex dump> parameter can be added for the wnm_sleep command to specify the TFS request element to use in the WNM-Sleep Mode Request frame. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Avoid multi-channel scans when they are not neededJouni Malinen2012-11-251-0/+2
| | | | | | | | | | | | If the driver does not support multi-channel concurrency and a virtual interface that shares the same radio with the current interface is operating there may not be need to scan other channels apart from the current operating channel on the other virtual interface. Filter out other channels in case we are trying to find a connection for a station interface when we are not configured to prefer station connection and a concurrent operation is already in process. Signed-hostap: Jouni Malinen <j@w1.fi>
* Allow PMF to be enabled by defaultJouni Malinen2012-11-241-1/+3
| | | | | | | | | | Previously, PMF (protected management frames, IEEE 802.11w) could be enabled only with a per-network parameter (ieee80211w). The new global parameter (pmf) can now be used to change the default behavior to be PMF enabled (pmf=1) or required (pmf=2) for network blocks that do not override this with the ieee80211w parameter. Signed-hostap: Jouni Malinen <j@w1.fi>
* Verify that the selected BSS has a better signal level before roamingRobert Shade2012-11-241-0/+6
| | | | | | | | | | | | | | This prevents situations like the following where we roam to a lesser quality BSS just because the signal level delta is over our threshold. wlan0: Considering within-ESS reassociation wlan0: Current BSS: 00:24:6c:74:0a:40 level=-51 wlan0: Selected BSS: 00:24:6c:74:0a:e0 level=-64 wlan0: Request association: reassociate: 0 selected: 00:24:6c:74:0a:e0 bssid: 00:24:6c:74:0a:40 pending: 00:00:00:00:00:00 wpa_state: COMPLETED Signed-hostap: Robert Shade <robert.shade@gmail.com>
* Use deauthentication instead of disassociation if not associatedJouni Malinen2012-11-051-2/+2
| | | | | | | | cfg80211/mac80211 may reject disassociation command if association has not yet been formed. Use deauthentication in cases where it is possible that we are associating at the moment the command is issued. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Handle assoc reject events without wpa_supplicant SMEJouni Malinen2012-11-031-0/+7
| | | | | | | | | | | | | | | | | | | If the driver indicates the association (or authentication) was rejected, wpa_supplicant should handle this connection failure similarly to other cases. Previously, this was only handled with drivers that use wpa_supplicant SME. In case of cfg80211-based drivers, a rejected association was actually already handled since cfg80211 generates a deauthentication event after indicating connection failure. However, rejected authentication resulted in wpa_supplicant waiting for authentication timeout to expire which is unnecessary long wait. Fix this by calling wpas_connection_failed() to use the common mechanism to reschedule a new connection attempt with the previously attempted BSSID blacklisted. Signed-hostap: Jouni Malinen <j@w1.fi>
* Filter out unlikely "pre-shared key may be incorrect" messagesJouni Malinen2012-10-081-2/+23
| | | | | | | | | | | | | Add a function to filter out known cases of disconnection during 4-way handshake that are caused by something else than mismatch in PSK. This commit adds the case where the local end determines a mismatch in WPA/RSN element between Beacon/Probe Response frames and EAPOL-Key msg 3/4. This can avoid some potentially confusing "WPA: 4-Way Handshake failed - pre-shared key may be incorrect" ctrl_iface messages. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Add disallow_aps parameter to disallow BSSIDs/SSIDsJouni Malinen2012-09-271-0/+16
| | | | | | | | | | | | | | | | | | | | | | | External programs can use this new parameter to prevent wpa_supplicant from connecting to a list of BSSIDs and/or SSIDs. The disallowed BSSes will still be visible in scan results and it is possible to run ANQP operations with them, but BSS selection for connection will skip any BSS that matches an entry in the disallowed list. The new parameter can be set with the control interface SET command using following syntax: SET disallow_aps <disallow_list> disallow_list ::= <ssid_spec> | <bssid_spec> | <disallow_list> | “” SSID_SPEC ::= ssid <SSID_HEX> BSSID_SPEC ::= bssid <BSSID_HEX> For example: wpa_cli set disallow_list "ssid 74657374 bssid 001122334455 ssid 68656c6c6f" wpa_cli set disallow_list (the empty value removes all entries) Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Fix pending-sta-scan processing for concurrent operation casesJouni Malinen2012-09-241-1/+5
| | | | | | | | | | | | | | | | | If two P2P_FIND commands and a station mode SCAN command are issued in a sequence with the second P2P_FIND and SCAN commands started before the initial scan from the first P2P_FIND command has completed, sta_scan_pending may be left set without an automatic way of getting it cleared. This can get P2P search stuck if no further station mode scan operations are run. Fix this by clearing the sta_scan_pending flag whenever station mode scans are stopped due to no enabled networks resulting in INACTIVE mode getting entered. In addition, avoid setting sta_scan_pending flag when a special scan_res_handler is set so that this does not get enabled on the P2P Device interface during a P2P search operation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Add more debug prints for GO start routinesJouni Malinen2012-09-231-0/+2
| | | | | | This makes it easier to debug issues in starting GO mode. Signed-hostap: Jouni Malinen <j@w1.fi>
* Do not inform other virtual interfaces of scan results in all casesJouni Malinen2012-09-141-4/+11
| | | | | | | | | | | If a connection operation is started on an interface based on scan results, other virtual interfaces should not be information about the results to avoid potential concurrent operations during the association steps. Since the sibling notification of scan results received was added as an optimization, skipping it for this type of cases is the simplest way of avoiding unnecessary concurrent operations. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Schedule new scan if P2P operation delays scanJouni Malinen2012-09-141-0/+2
| | | | | | | This makes sure that the interrupted station mode scan can be completed after the P2P operations have had their chance of using the radio. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Move p2p_cb_on_scan_complete to global contextJouni Malinen2012-09-141-4/+5
| | | | | | | | | | | Since we have a global P2P module, the flag to trigger scan completion events to it needs to be in similar context. The previous design maintained this separately for each virtual interface and if P2P module did not run its scan operation on the virtual interface that completed the scan, P2P module would not be allowed to restart operations properly. Signed-hostap: Jouni Malinen <j@w1.fi>
* Interworking: Skip extra scan after network auto-selectJouni Malinen2012-09-021-2/+9
| | | | | | | | If the scan results from before ANQP fetch are fresh (less than five seconds old), do not run a new scan when selecting the BSS after having used Interworking network selection. Signed-hostap: Jouni Malinen <j@w1.fi>
* Use BSS entries instead of scan results for BSS selectionJouni Malinen2012-09-021-38/+28
| | | | | | | | This allows the BSS selection functions to be called without having the scan result data structure. This can be used to skip extra scans in cases where previous results can be considered fresh. Signed-hostap: Jouni Malinen <j@w1.fi>
* Use BSS table instead of scan results in need-to-roam determinationJouni Malinen2012-09-021-23/+17
| | | | | | | The same information is available in the BSS table, so we can reduce the need for using the raw scan results in wpa_supplicant_need_to_roam(). Signed-hostap: Jouni Malinen <j@w1.fi>
* SME: Fix disconnec-while-authenticatingJouni Malinen2012-09-011-1/+5
| | | | | | | | | | Commit 0d30cc240fa36905b034dc9676f9d8da0ac18e56 forced wpa_s->current_ssid to be cleared in wpa_supplicant_mark_disassoc() which gets called from wpa_supplicant_event_disassoc(). This broke SME disassoc-while-authenticating workaround for cfg80211. Fix this by restoring wpa_s->current_ssid in case SME authentication is in progress. Signed-hostap: Jouni Malinen <j@w1.fi>
* Fix disconnection event processingJouni Malinen2012-08-311-12/+44
| | | | | | | | | | | | | | | | | | | Commit 0d30cc240fa36905b034dc9676f9d8da0ac18e56 forced wpa_s->current_ssid and wpa_s->key_mgmt to be cleared in wpa_supplicant_mark_disassoc() which gets called from wpa_supplicant_event_disassoc(). This broke IEEE 802.1X authentication failure processing and P2P deauthentication notification (group termination). Fix this by splitting wpa_supplicant_event_disassoc() into two parts and make wpas_p2p_deauth_notif() indicate whether the interface was removed. If so, the last part of disassocition event processing is skipped. Since the wpa_supplicant_mark_disassoc() call is in the second part, the above mentioned issues are resolved. In addition, this cleans up the P2P group interface removal case by not trying to use fast reconnection mechanism just before the interface gets removed. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Move variable declaration into the beginning of functionJouni Malinen2012-08-291-1/+3
| | | | | | | The variables used within the #ifndef block here needs to be defined in the beginning of the function to avoid issues with some compilers. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Interworking: Add optional use of network selection on normal scansJouni Malinen2012-08-281-0/+14
| | | | | | | | | | auto_interworking=1 configuration parameter can be used to request wpa_supplicant to use Interworking network selection automatically as a part of the normal (non-Interworking) network selection if the scan results do not match with enabled networks. This makes scanning work similarly to the "interworking_select auto" command. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Maintain more AP state during WPS PIN iterationJouni Malinen2012-08-271-0/+4
| | | | | | | | | | | Maintain state of WPS APs during iteration to find the correct AP for WPS PIN operation when no specific BSSID is specified. This information can be used for optimizing the order in which the APs are tried. This commit is only adding the collection of the information and more detailed debug information to make debug logs more helpful in figuring out how the AP selection order could be improved. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Clear current_ssid and key_mgmt when disconnectedJouni Malinen2012-08-261-0/+2
| | | | | | | | This makes wpa_supplicant state somewhat cleaner since the information from previously used connection is not maintained after getting disconnected. Signed-hostap: Jouni Malinen <j@w1.fi>
* Disable network block temporarily on authentication failuresJouni Malinen2012-08-261-0/+40
| | | | | | | | If 4-way handshake fails due to likely PSK failure or if EAP authentication fails, disable the network block temporarily. Use longer duration if multiple consecutive failures are seen. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Allow scan operations during p2p_findJouni Malinen2012-08-231-1/+14
| | | | | | | | | | | | | Previously, all station mode scan operations were either skipped or delayed while any P2P operation was in progress. To make concurrent operations easier to use, reduce this limitation by allowing a scan operation to be completed in the middle of a p2p_find. In addition, allow station mode association to be completed. When the station mode operation is run to its completion (scan results not acted on, connection to an AP completed, connection failed), resume the p2p_find operation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Allow non-WPA IEEE 802.1X to be select even if WPA is also enabledJouni Malinen2012-08-151-0/+6
| | | | | | | | | | If key_mgmt was set to allow both WPA and non-WPA IEEE 802.1X (i.e., to IEEE8021X WPA-EAP), non-WPA IEEE 802.1X was rejected while preparing association parameters. Allow this special case to be handled by selecting non-WPA case if the scan results for the AP do not include either WPA or RSN elements. Signed-hostap: Jouni Malinen <j@w1.fi>
* Remove unnecessary bssid_changed checkJouni Malinen2012-08-111-4/+1
| | | | | | | The os_memcmp of bssid and wpa_s->bssid cannot return 0 in this code path since identical os_memcmp was already done above. Signed-hostap: Jouni Malinen <j@w1.fi>
* Do not proceed with association if get_bssid() returns failureMasashi Honma2012-08-111-2/+8
| | | | | | | | | | | | | | | | | | | | | This is the normal flow for association: wpa_supplicant <--(EVENT_ASSOC event )-- device driver wpa_supplicant --( get_bssid() )--> device driver wpa_supplicant <--( return BSSID )-- device driver However, a device driver could return EINVAL for get_bssid() because it recognizes it has already been disconnected. When the wpa_supplicant received EINVAL, the bssid field could be used uninitialized in the following flow: wpa_supplicant <--(EVENT_ASSOC event )-- device driver device driver (receive deauth) wpa_supplicant --( get_bssid() )--> device driver wpa_supplicant <--( return EINVAL )-- device driver Prevent this by requiring the get_bssid() call to succeed when processing association events.
* WNM: Add WNM-Sleep Mode for station modeXi Chen2012-08-011-0/+31
| | | | Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Do not share special scan results with virtual interfacesJouni Malinen2012-06-301-2/+3
| | | | | | | | | When a special scan_res_handler is used the scan parameters may not have been suitable for other purposes (e.g., during a p2p_find operation). As such, do not indicate such scan results to other virtual interfaces using the same radio. Signed-hostap: Jouni Malinen <j@w1.fi>
* Export disconnect reason code to dbusGary Morain2012-06-301-0/+5
| | | | | | | | | | | In the properties changed signal, added a new property "DisconnectReason", which carries the IEEE 802.11 reason code of the most recent disassociation or deauthentication event. The reason code is negative if it is locally generated. The property is sent to the DBUS immediately so as to prevent it from being coalesced with other disconnect events. Signed-off-by: Gary Morain <gmorain@chromium.org>
* Add automatic scanning supportTomasz Bursztyka2012-06-261-0/+6
| | | | | | | | | | | | | | | | | | | Like bgscan, autoscan is an optional module based feature to automate scanning but while disconnected or inactive. Instead of requesting directly a scan, it only sets the scan_interval and the sched_scan_interval. So, if the driver supports sched_scan, autoscan will be able to tweak its interval. Otherwise, the tweaked scan_interval will be used. If scan parameters needs to be tweaked, an autoscan_params pointer in wpa_s will provide those. So req_scan / req_sched_scan will not set the scan parameters as they usually do, but instead will use this pointer. Modules will not have to request a scan directly, like bgscan does. Instead, it will need to return the interval it wants after each notification. Signed-hostap: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
* nl80211: Handle CH_SWITCH eventThomas Pedersen2012-06-251-0/+15
| | | | | | | Some drivers may independently decide to switch channels. Handle this by updating the hostapd and wpa_supplicant AP and GO configuration. Signed-hostap: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
* P2P: Do not use reassociation after getting disassociatedJouni Malinen2012-06-101-0/+3
| | | | | | | | This avoids issues with some APs rejecting a reassociation if the station is not currently associated as reported by Yossi Wortzel. The change is based on a patch from Arik Nemtsov. Signed-hostap: Jouni Malinen <j@w1.fi>
* WNM: Send empty IPv4 packet as keep-alive for nowJouni Malinen2012-05-281-3/+5
| | | | | | | | | Use an empty IPv4 packet as the keep-alive packet for WNM BSS max idle period mechanism. This is not really the best possible frame to use for this, but for now, it can do until a more suitable frame is figured out for this (e.g., special LLC header to indicate link test purposes). Signed-hostap: Jouni Malinen <j@w1.fi>
* WNM: Fix build without CONFIG_SME=yJouni Malinen2012-05-281-0/+2
| | | | | | | Commit b6668734ab8ac235f129d1cd0aff4c4e1c922b41 missed #ifdef CONFIG_SME protection around wpa_s->sme access. Signed-hostap: Jouni Malinen <j@w1.fi>
* WNM: Add advertisement of BSS max idle periodJouni Malinen2012-05-281-0/+78
| | | | | | | | | | | If WNM is enabled for the build (CONFIG_WNM=y), add BSS max idle period information to the (Re)Association Response frame from the AP and parse this information on the station. For SME-in-wpa_supplicant case, add a timer to handle periodic transmission of the keep-alive frame. The actual request for the driver to transmit a frame is not yet implemented. Signed-hostap: Jouni Malinen <j@w1.fi>
* Validate WEP key lengths based on driver capabilitiesJouni Malinen2012-05-101-5/+5
| | | | | | | | | | The nl80211 driver interface does not allow 128-bit WEP to be used without a vendor specific cipher suite and no such suite is defined for this purpose. Do not accept WEP key length 16 for nl80211 driver interface forn ow. wext-interface can still try to use these for backwards compatibility. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow older scan results to improve p2p_connect-auto robustnessJouni Malinen2012-05-081-0/+3
| | | | | | | | | | | | Previusly the peer was assumed to not be operating a GO if the BSS entry for it was not updated in the single scan run started by p2p_connect-auto. This is not very robust since a scan may miss the peer if either a Probe Request or Probe Response frame is lost. Improve robustness by assuming the peer is still operating the GO and starting the join operation. If the GO is not found during PD-for-join or the single-channel scans during the join, fall back to GO Negotiation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Ignore network blocks that have invalid WEP key lengthJouni Malinen2012-05-071-3/+3
| | | | | | | | | | | | | Do not try to associate with a network that has an invalid or incomplete configuration because the association or at least data connection would fail anyway. This commits adds a common function for checking whether a network block is disabled to make it easier to check network blocks without having to reject them during configuration file parsing (which would prevent wpa_supplicant from starting). The only additional check added in this commit is to verify the WEP key length. Similar checks for other parameters can be added in future commits. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>