path: root/wpa_supplicant/events.c
Commit message (Collapse)AuthorAgeFilesLines
* Report connection timeouts in CTRL-EVENT-ASSOC-REJECTJouni Malinen2016-05-301-4/+6
| | | | | | | | | Add a new "timeout" argument to the event message if the nl80211 message indicates that the connection failure is not due to an explicit AP rejection message. This makes it easier for external programs to figure out why the connection failed. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix sending non-Public Action frames over P2P Device interfaceLior David2016-05-201-4/+7
| | | | | | | | | | | | | | | | | | | | | | The P2P Device interface can only send Public Action frames. Non-Public Action frames must be sent over a group interface. The previous implementation sometimes tried to send non-Public Action frames such as GO Discoverability over the P2P Device interface, however, the source address of the frame was set to the group interface address so the code in offchannel.c knew to select the correct interface for the TX. The check breaks when the P2P Device and group interfaces have the same MAC address. In this case the frame will be sent over the P2P Device interface and the send will fail. Fix this problem in two places: 1. In offchannel, route non-Public Action frames to the GO interface when the above conditions are met. 2. When a TX_STATUS event arrives on such routed frame, it will arrive on the GO interface but it must be handled by the P2P Device interface since it has the relevant state logic. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
* Send CTRL-EVENT-REGDOM-CHANGE event on the parent interfaceIlan Peer2016-05-141-1/+10
| | | | | | | | | | | | | | The NL80211_CMD_WIPHY_REG_CHANGE can be handled by any of the interfaces that are currently controlled by the wpa_supplicant. However, some applications expect the REGDOM_CHANGE event to be sent on the control interface of the initially added interface (and do not expect the event on any of child interfaces). To resolve this, when processing NL80211_CMD_WIPHY_REG_CHANGE, find the highest parent in the chain, and use its control interface to emit the CTRL-EVENT-REGDOM-CHANGE event. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* Skip connection attempt for non-RSN networks if PMF is set to requiredSunil Dutt2016-05-051-0/+8
| | | | | | | | Since ieee80211w=2 is an explicit configuration to wpa_supplicant, the connection attempt for such non-PMF (non-RSN) capable networks should be skipped. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_supplicant: Handle LCI requestDavid Spinadel2016-04-171-0/+8
| | | | | | | | | | | | | | Handle radio measurement request that contains LCI request. Send measurement report based on a configurable LCI report element. The LCI report element is configured over the control interface with SET lci <hexdump of the element> and cleared with SET lci "" Signed-off-by: David Spinadel <david.spinadel@intel.com>
* HS 2.0: Add support for configuring frame filtersMatti Gottlieb2016-04-081-0/+5
| | | | | | | | | | | | | | | When a station starts an association to a Hotspot 2.0 network, request the driver to do the following, based on the BSS capabilities: 1. Enable gratuitous ARP filtering 2. Enable unsolicited Neighbor Advertisement filtering 3. Enable unicast IP packet encrypted with GTK filtering if DGAF disabled bit is zero Clear the filter configuration when the station interface is disassociated. Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
* wpa_supplicant: "don't care" value for pbss in ssid structureLior David2016-04-081-1/+1
| | | | | | | | | | Add a new value 2 to the pbss parameter of wpa_ssid structure, which means "don't care". This value is used in infrastructure mode to request connection to either AP or PCP, whichever is available in the scan results. The value is also used in regular WPS (not P2P group formation) to make WPS work with devices running as either AP or PCP. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
* Fix race condition with PNO stop followed immediately by PNO startHu Wang2016-04-061-1/+0
| | | | | | | | | | | | | | | | | | | | Commit dd271857a5b501cd88143efe8ca0f0dce4519a91 ('Skip normal scan when PNO is already in progress') fixed issues with normal scans getting rejected by the driver when PNO scan is already running. The part about skipping such a scan request is fine, but the part about clearing wpa_s->pno back to 0 in EVENT_SCHED_SCAN_STOPPED handler is problematic. If PNO is stopped ("SET pno 0") and then restarted ("SET pno 1") immediately, it is possible for the EVENT_SCHED_SCAN_STOPPED event from the stopping part to be received only after the new PNO instance has been started. This would have resulted in clearing wpa_s->pno and the driver and wpa_supplicant getting out of sync. This would then prevent PNO from being stopped with "SET pno 0" (that fails if wpa_s->pno == 0). Fix this race condition by reverting the wpa_s->pno = 0 addition from the EVENT_SCHED_SCAN_STOPPED handler. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_supplicant: Do not use struct ieee80211_mgmt::u.probe_reqJouni Malinen2016-04-021-10/+13
| | | | | | | | | | This struct in the union is empty, but the design of using a zero-length u8 array here is not fully compatible with C++ and can result in undesired compiler warnings. Since there are no non-IE fields in the Probe Request frames, get the location of the variable length IEs simply by using the pointer to the frame header and the known header length. Signed-off-by: Jouni Malinen <j@w1.fi>
* Make it a bit easier to roam from 2.4 GHz to 5 GHz within ESSJouni Malinen2016-03-251-1/+12
| | | | | | | | | | The initial connection to an ESS was already explicitly increasing the likelihood of picking a 5 GHz BSS. While the throughput estimation is likely to do same for the roaming decision, it might be possible that that does not cover all cases. Add couple of dB extra preference for 5 GHz in case the roaming decision falls back to comparing signal levels. Signed-off-by: Jouni Malinen <j@w1.fi>
* Add interface matching support with -M, guarded by CONFIG_MATCH_IFACERoy Marples2016-03-221-0/+21
| | | | | | | | | The new wpa_supplicant command line argument -M can be used to describe matching rules with a wildcard interface name (e.g., "wlan*"). This is very useful for systems without udev (Linux) or devd (FreeBSD). Signed-off-by: Roy Marples <roy@marples.name>
* Find correct driver for interface additions/removalsRoy Marples2016-03-221-0/+26
| | | | | | | | | Interface additions/removals are not guaranteed to be for the driver listening to the kernel events. As such, send the events to wpa_supplicant_event_global() which can then pick the correct interface registered with wpa_supplicant to send the event to. Signed-off-by: Roy Marples <roy@marples.name>
* Handle OSEN IE in Assoc Request info if req_ies existsDaisuke Niwa2016-03-201-0/+2
| | | | | | | | | | The 4-way handshake fails with the error "WPA: No wpa_ie set - cannot generate msg 2/4" while connecting to OSEN network with drivers that indicate used Association Request frame elements because OSEN IE is not handled in wpa_supplicant_event_associnfo() if data->assoc_info.req_ies is not NULL. Signed-off-by: Daichi Ueura <daichi.ueura@sonymobile.com>
* D-Bus: Add association response status code property for failure casesNaveen Singh2016-03-061-0/+2
| | | | | | | | | | (Re)Association Response frame with status code other than 0 is now notified over DBUS as a part of PropertiesChanged signal. This can be used by application in case AP is denying association with status code 17 (band steering) so that it does not interfere in the BSSID selection logic of wpa_supplicant. Signed-off-by: Naveen Singh <nasingh@google.com>
* wpa_supplicant: Handle EVENT_SCAN_RESULTS when an interface is disabledIlan Peer2016-03-031-0/+9
| | | | | | | | | | | | | An interface can be disabled while it has an ongoing scan request. In such a case, when the scan results notification is received, it was being ignored (as the interface is already disabled) so the scan state was not cleared. This can cause undetermined behavior for the next scan request. To handle this, clear the scan state when EVENT_SCAN_RESULTS is received and the interface is disabled. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* Fix scan rescheduling from wpas_stop_pno to check postponed caseJouni Malinen2016-03-031-1/+1
| | | | | | | | | | | | | | Commit 02e122a995dea947a2ad2c0d85190d709f9128b7 ('Reschedule scan from wpas_stop_pno if it was postponed') uses wpa_s->scanning as the only condition for automatically starting a postponed scan request from EVENT_SCHED_SCAN_STOPPED event handler. However, wpa_s->scanning may be set for sched_scan and as such, this can result in unexpected extra scans without there having been any real postponed request. Make this more accurate by verifying that there really is a pending request for a scan before speeding up its start. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* MBO: Mandate use of PMF for WPA2+MBO association (STA)Jouni Malinen2016-02-221-0/+10
| | | | | | | If WPA2 is used, MBO AP must enable PMF. Refuse to select a BSS that has MBO and WPA2 enabled without PMF. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* WNM: Add candidate list to BSS transition responseAvraham Stern2016-02-221-4/+4
| | | | | | | | | Add the transition candidate list to BSS Transition Management Response frame. The candidates preference is set using the regular wpa_supplicant BSS selection logic. If the BSS transition request is rejected and updated scan results are not available, the list is not added. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* MBO: Parse MBO IE in BSS Transition Management Request framesAvraham Stern2016-02-221-1/+8
| | | | | | | | | | | | | Add parsing of MBO IE in BSS Transition Management Request frames. If the MBO IE includes the association retry delay attribute, do not try to reconnect to the current BSS until the delay time is over. If the MBO IE includes the cellular data connection preference attribute or the transition rejection reason attribute, send a message to upper layers with the data. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* MBO: Prevent association to APs that explicitly disallow thisDavid Spinadel2016-02-221-0/+13
| | | | | | | Prevent association to MBO APs that have association disallowed attribute in MBO IE in Beacon or Probe Response frames. Signed-off-by: David Spinadel <david.spinadel@intel.com>
* wpa_supplicant: Basic support for PBSS/PCPLior David2016-02-081-2/+8
| | | | | | | | | | | | | | | | | | | | | PBSS (Personal Basic Service Set) is a new BSS type for DMG networks. It is similar to infrastructure BSS, having an AP-like entity called PCP (PBSS Control Point), but it has few differences. PBSS support is mandatory for IEEE 802.11ad devices. Add a new "pbss" argument to network block. The argument is used in the following scenarios: 1. When network has mode=2 (AP), when pbss flag is set will start as a PCP instead of an AP. 2. When network has mode=0 (station), when pbss flag is set will connect to PCP instead of AP. The function wpa_scan_res_match() was modified to match BSS according to the pbss flag in the network block (wpa_ssid structure). When pbss flag is set it will match only PCPs, and when it is clear it will match only APs. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
* wpa_supplicant: Enable Automatic Channel Selection support for AP modeTomasz Bursztyka2015-12-241-0/+8
| | | | | | | | | | Since hostapd supports ACS now, let's enable its support in wpa_supplicant as well when starting AP mode. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> [u.oelmann@pengutronix.de: rebased series from hostap_2_1~944 to master] [u.oelmann@pengutronix.de: adjusted added text in defconfig] Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
* Handle survey event properly in wpa_supplicantTomasz Bursztyka2015-12-241-0/+8
| | | | | | | | | | Let's reuse hostapd code for such handling. This will be useful to get ACS support into wpa_supplicant where this one needs to handle the survey event so it fills in the result ACS subsystem will require. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> [u.oelmann@pengutronix.de: rebased series from hostap_2_1~944 to master] Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
* Disconnect before trying to switch to a different networkAyala Beker2015-12-171-0/+7
| | | | | | | | | | | | | Previously, when wpa_supplicant received bgscan results with a preferred network, it connected to that network without disconnecting from the previous one. This might result in an inconsistent state of upper layers. Fix this by disconnecting from the current AP before connecting to the new one when the network profile changes and there is an existing connection. Signed-off-by: Ayala Beker <ayala.beker@intel.com>
* Avoid network selection from scan during connectionArik Nemtsov2015-12-171-0/+4
| | | | | | | | | | If scan results arrive during the connection process, the network selection function was called, interrupting the current connection. While a regular scan is mutually exclusive with connection establishment via the nature of radio work, there's no such protection for scheduled scan. Prevent network selection while a connection is in progress. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
* FST: Print debug entry on MB IE update based on EVENT_AUTHJouni Malinen2015-12-061-1/+4
| | | | | | | This is more consistent with all the other callers of wpas_fst_update_mbie(). Signed-off-by: Jouni Malinen <j@w1.fi>
* FST: Improve parsing of Multiband IEsDedy Lansky2015-11-251-13/+88
| | | | | | | | | | Previously, MB IEs were parsed only from association event. Try to get MB IEs from other management frames like Probe Response frames. The MB IEs from the association event may not be up-to-date and in some cases may actually be missing and updating the information based on other frames can improve robustness of FST exchanges. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Comment out wpas_reenabled_network_time with CONFIG_NO_SCAN_PROCESSINGJouni Malinen2015-11-231-0/+2
| | | | | | This removes a compiler warning about unused function. Signed-off-by: Jouni Malinen <j@w1.fi>
* Add QCA vendor attribute and event to indicate subnet change statusRavi Joshi2015-11-201-0/+5
| | | | | | | | | | | | | | | | | | This allows offloaded roaming to inform user space of the change in IP subnet post roaming. The device may have roamed to a network which is in a different subnet which will result in IP connectivity loss. Indicating the change in subnet enables the user space to refresh the IP address or to perform IP subnet validation if unknown status is indicated. The driver indication is reported with a new event from wpa_supplicant in the following format: CTRL-EVENT-SUBNET-STATUS-UPDATE status=<0/1/2> where 0 = unknown 1 = IP subnet unchanged (can continue to use the old IP address) 2 = IP subnet changed (need to get a new IP address) Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Reconnect for a failed data connection when STA_AUTOCONNECT is 0Sunil Dutt2015-11-171-1/+2
| | | | | | | | | | | | | | | | | If "STA_AUTOCONNECT 0" has been used to disable automatic connection on disconnection event and the driver indicates a failure for the data connection after successful WPS handshake, it is possible to hit a case where wpa_s->disconnected is set to 1 and further attempts to connect shall stop. While "STA_AUTOCONNECT 0" is used to disable automatic reconnection attempts in general, this specific WPS case can benefit from trying again even with that configuration for a short period of time. Extend the wpa_supplicant re-enable-networks-after-WPS 10 second timeout to apply for ignoring disabled STA_AUTOCONNECT immediately after a WPS provisioning step. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* WNM: Ignore WNM-Sleep Mode Response if WNM-Sleep Mode has not been usedJouni Malinen2015-11-101-0/+1
| | | | | | | | The AP is not expected to send out a WNM-Sleep Mode Response frame without the STA trying to use WNM-Sleep Mode. Drop such unexpected responses to reduce unnecessary processing of the frame. Signed-off-by: Jouni Malinen <j@w1.fi>
* RSN: Do not try to connect if PMF disabled and AP requires itJouni Malinen2015-10-251-0/+7
| | | | | | | | Instead of trying to associate in configuration that is known to result in the AP rejecting the association, reject the BSS candidate based on the MFPR=1 RSN capability when STA configuration has PMF disabled. Signed-off-by: Jouni Malinen <j@w1.fi>
* Handle channel switch notification for other interface typesIlan Peer2015-10-031-12/+15
| | | | | | | | Channel switch notification was handled only for AP/GO interfaces. As the notification can be sent on other interface types as well, extend the handling to handle other interface types. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Trigger channel selection correctly during CSAAndrei Otcheretianski2015-10-031-0/+2
| | | | | | | | Do not consider moving GOs to a new channel if one of them is in the middle of CSA. In addition, call wpas_p2p_update_channel_list() after EVENT_CH_SWITCH is handled. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* nl80211: Support vendor scan together with normal scanKanchanapally, Vidyullatha2015-09-301-11/+19
| | | | | | | | | | Allow wpa_supplicant to use vendor scan (if supported by the driver) together with the normal nl80211 scan and handling external scan events. Since this results in possibility of concurrent scan operations, some of the operations related to scan results need to check more carefully when an event is relevant for a specific interface. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* D-Bus: Add Signal to notify WPS PBC Overlap eventSaurav Babu2015-09-271-0/+1
| | | | Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
* Update AP WPA/RSN IE on all associations if driver can select BSSSunil Dutt2015-09-171-6/+8
| | | | | | | | | | | | | | | | | | | | It is possible for driver-based BSS selection to end up reassociating back to the current AP. If wpa_supplicant preferred another BSS, it would have updated the internal knowledge of the AP's WPA/RSN IE when requesting a new connection. In the special case of existing association and new association being with the same BSS that is different from the wpa_supplicant preference, association event processing skipped the WPA/RSN IE update. This could result in the following 4-way handshake getting rejected due to incorrectly detected mismatch with AP's RSN/WPA IE between Beacon/Probe Response frame and EAPOL-Key msg 3/4. Fix this by updating the AP WPA/RSN IE on all association events when driver-based BSS selection is used regardless of whether the BSSID changes. This could also cover a theoretical case of the AP changing its RSN/WPA IE at the very moment we try to reassociate back to the same BSS. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Add BSS operating frequency to more debug messagesJouni Malinen2015-09-051-2/+2
| | | | | | | This makes it easier to analyze debug logs when figuring out channel related issues. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Require fresh scan results for persistent group re-invocationJouni Malinen2015-08-211-0/+13
| | | | | | | | | | | | | | | | | | The P2P group is not yet operating when going through invitation exchange for re-invocation. Previously, an old cached scan result could be used to skip the scan immediately after the invitation exchange. While this may result in the fastest possible connection, it does have some issues with cases where the GO takes some time to start up. It would also be at least theoretically possible for some of the BSS parameters to be different, so having a fresh scan result from the new GO instance may be desired in any case. Add a mechanism to skip scan results that have been last updated before a specific point in time and as the first user for this mechanism, require chan results to be more recent than the invitation message exchange for the P2P Client role in persistent group re-invocation case. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Do not stop ongoing PNO sched_scan on association/disconnectionMahesh A Saptasagar2015-08-131-1/+2
| | | | | | | | | | PNO was stopped by the wpa_supplicant during the connection attempts or while handling disassociation indication. External entities, mainly, the Android Wi-Fi framework, does not expects PNO to be stopped by other modules. Hence, do not stop the sched_scan in these scenarios if it is triggered externally for PNO. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Do not perform P2P GO CS in some casesIlan Peer2015-08-041-2/+3
| | | | | | | | | | | | A P2P GO channel switch should not be triggered in all cases that require channel list update. Specifically, a P2P GO CS should not be triggered in case that the P2P GO state changed or in case that that the P2P GO has just completed a CS. To fix this, add reason code to wpas_p2p_channel_list_update() and trigger CS flow only for the relevant cases. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* Refactor channel list update event in wpa_supplicantArik Nemtsov2015-08-041-17/+7
| | | | | | | | | Update hardware features for all interfaces inside the loop, don't treat the calling wpa_s instance specially. Perform the P2P channel list updates after the hardware features are updated. This will prevent P2P from relying on stale information. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
* P2P: Remove GO handling in avoid frequency eventIlan Peer2015-08-031-25/+5
| | | | | | | | Remove the code that considers removing GOs from their current channel due to frequency interference, as this is already handled as part of the P2P channels update. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Do not clear wpa_s->go_dev_addr before group removalJouni Malinen2015-08-021-3/+0
| | | | | | | | | | | | | | | This variable is needed to figure out whether a wpa_supplicant interface is for a P2P group that is (or was) connected to a specific GO. The previous implementation was able to find such a case only when there was an association with the GO. However, this may be needed even if there is a temporary disconnection from the GO. Keep the GO device address information over such temporary disconnections and only remove it on group termination. This fixes an issue with D-Bus Peer PropertiesChanged signals for the Groups property in case a P2P group gets removed due to group idle timeout instead of explicit group termination command (local request) or GO notification. Signed-off-by: Jouni Malinen <j@w1.fi>
* FST: Send FST Action frame for processing (wpa_supplicant)Anton Nayshtut2015-07-161-0/+8
| | | | Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* FST: Integration into wpa_supplicantAnton Nayshtut2015-07-161-0/+13
| | | | | | This commit integrates the FST into the wpa_supplicant. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Send CTRL-EVENT-NETWORK-NOT-FOUND if no suitable network was foundDmitry Shmidt2015-06-271-0/+3
| | | | | | | | This provides more information to upper layer programs on what happens with connection attempts in cases where the enabled networks are not found in scan results. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* Do not check unsigned size is less than zeroJouni Malinen2015-06-231-1/+1
| | | | | | | The variables here are unsigned and as such, cannot have a negative value. Use == 0 instead of <= 0 to make this cleaner. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Handle P2P Device dedicated interface parent removalIlan Peer2015-06-191-0/+30
| | | | | | | | | | | | | | | | | In case of a network interface removal, check if the interface was also the parent interface of the P2P Device dedicated interface. If this is the case, then stop the P2P Device functionality, and remove the P2P Device dedicated interface. In case that the interface is added again and P2P Device functionality can be enabled again, add a new P2P Device dedicated interface and allow further P2P Device functionality. In case that the P2P Device dedicated interface is re-created, the original P2P Device configuration file is needed, so store it in the global params (instead in the wpa_interface configuration). Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Add rx_freq parameter to Probe Request frame handlerMax Stepanov2015-06-141-0/+2
| | | | | | | | | | | In some cases, Probe Request frames can be received by a peer not only on a listen channel. In this case an additional rx_freq parameter explitly contains a Probe Request frame RX frequency. In case rx_freq is set to 0, a Probe Request frame RX channel is assumed to be our own listen channel (p2p->cfg->channel). Signed-off-by: Max Stepanov <Max.Stepanov@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>