aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ap.c
Commit message (Collapse)AuthorAgeFilesLines
* Initialize iface->sta_seen on allocationJouni Malinen2016-09-211-1/+1
| | | | | | | | | | | | Previously, struct hostapd_iface sta_seen list head was initialized only when completing interface setup. This left a window for operation that could potentially iterate through the list before the list head has been initialized. While the existing code checked iface->num_sta_seen to avoid this case, it is much cleaner to initialize the list when struct hostapd_iface is allocated to avoid any accidental missing of the extra checks before list iteration. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_supplicant: Allow FTM functionality to be publishedLior David2016-09-051-0/+3
| | | | | | | | | | | | Add configuration options that control publishing of fine timing measurement (FTM) responder and initiator functionality via bits 70, 71 of Extended Capabilities element. Typically, FTM functionality is controlled by a location framework outside wpa_supplicant. When framework is activated, it will use wpa_supplicant to configure the STA/AP to publish the FTM functionality. See IEEE P802.11-REVmc/D7.0, 9.4.2.27. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
* wpa_supplicant: Configurable EAP fragment size in AP modeLior David2016-06-241-0/+2
| | | | | | | | | | | | | In wpa_supplicant AP mode, allow configuration of the EAP fragment size using the fragment_size member of network block (wpa_ssid), similar to the fragment_size in hostapd configuration. bss->fragment_size default value of 0 is treated specially in some EAP code paths (such as MTU initialization in eap_pwd_init). In order to preserve the existing behavior, bss->fragment_size will only be set if the network block specified a value different from the default which is DEFAULT_FRAGMENT_SIZE(1398) bytes. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
* nl80211: Use extended capabilities per interface typeKanchanapally, Vidyullatha2016-05-311-0/+5
| | | | | | | | | | This adds the necessary changes to support extraction and use of the extended capabilities specified per interface type (a recent cfg80211/nl80211 extension). If that information is available, per-interface values will be used to override the global per-radio value. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_supplicant: Add wps_disabled parameter to network blockLior David2016-05-141-0/+2
| | | | | | | Add a new parameter wps_disabled to network block (wpa_ssid). This parameter allows WPS functionality to be disabled in AP mode. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
* Set wpa_psk_set in wpa_supplicant AP mode is PSK is availableJouni Malinen2016-05-141-0/+1
| | | | | | | While this is unlikely to make any practical difference, it is better to keep consistent with hostapd configuration parser. Signed-off-by: Jouni Malinen <j@w1.fi>
* Fix AP mode key_mgmt configuration in wpa_supplicant default caseJouni Malinen2016-05-141-1/+4
| | | | | | | | | If the network profile key_mgmt parameter was not set, wpa_supplicant defaulted to enabling both WPA-PSK and WPA-EAP. This is not correct for AP mode operations, so remove WPA-EAP in such a case to fix WPA-PSK without explicit key_mgmt parameter. Signed-off-by: Jouni Malinen <j@w1.fi>
* wpa_supplicant: Fix CONFIG_AP build without CTRL_IFACEJohannes Berg2016-05-131-1/+1
| | | | | | | | wpas_ap_pmksa_cache_list() and wpas_ap_pmksa_cache_flush() should be under the #ifdef since they're only called for the control iface and use functionality that otherwise isn't available. Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
* wpa_supplicant: "don't care" value for pbss in ssid structureLior David2016-04-081-2/+7
| | | | | | | | | | 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>
* PMKSA: Flush AP/mesh PMKSA cache by PMKSA_FLUSH commandMasashi Honma2016-03-201-0/+14
| | | | | | | | | This extends the wpa_supplicant PMKSA_FLUSH control interface command to allow the PMKSA list from the authenticator side to be flushed for AP and mesh mode. In addition, this adds a hostapd PMKSA_FLUSH control interface command to flush the PMKSA entries. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* PMKSA: Show AP/mesh PMKSA list in PMKSA commandMasashi Honma2016-03-201-0/+38
| | | | | | | | | This extends the wpa_supplicant PMKSA control interface command to allow the PMKSA list from the authenticator side to be listed for AP and mesh mode. In addition, this adds a hostapd PMKSA control interface command to show the same list for the AP case. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* P2P: Add a separate pointer to the P2P Device instanceLior David2016-02-271-13/+13
| | | | | | | | | | | | | | | In many places in the code there was a reference to wpa_s->parent to get from group interface to p2p_dev interface. These places can break if P2P_DEVICE interface would need to be used with the primary interface as the group interface, since the parent of the primary interface points to itself and not the p2p_dev interface. Fix this by adding a separate "p2pdev" pointer to wpa_supplicant, it will be the same as parent pointer in most cases but whenever the primary interface is used as a group interface, change it to point to the correct p2p_dev interface. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
* WPS: Use only os_get_random() for PIN generationNick Lowe2016-02-191-2/+6
| | | | | | | | | Remove the fallback dependency on os_random() when generating a WPS pin. This is exceptionally unlikely to ever be called as the call to os_get_random() is unlikely to fail. The intention is to facilitate future removal of os_random() as it uses a low quality PRNG. Signed-off-by: Nick Lowe <nick.lowe@lugatech.com>
* wpa_supplicant: Basic support for PBSS/PCPLior David2016-02-081-0/+2
| | | | | | | | | | | | | | | | | | | | | 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>
* P2P: Fall back to no VHT when starting AP/P2P GOAvraham Stern2016-02-061-0/+1
| | | | | | | | | | | | | | | In cases where the bandwidth is not set when starting an AP/P2P GO, the code tries to use 160 MHz or 80 MHz channels. As a result, the AP/P2P GO configuration is set to use these channel widths even if they are not available, which may results in failing to start the AP/P2P GO. Fix this by changing the AP/P2P GO configuration not to use VHT channels when they are not available. In this case the AP/P2P GO will use a 40 MHz channel, if available, or a 20 MHz channel, if this is the maximum available width. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* wpa_supplicant: Enable Automatic Channel Selection support for AP modeTomasz Bursztyka2015-12-241-0/+13
| | | | | | | | | | 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>
* P2P: Add support for VHT 80+80 MHz and 160 MHzAhmad Kholaif2015-11-251-3/+30
| | | | | | | | | The new max_oper_chwidth and freq2 arguments to P2P_CONNECT, P2P_INVITE, and P2P_GROUP_ADD control interface commands can be used to request larger VHT operating channel bandwidth to be used than the previously used maximum 80 MHz. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Set CTWindow only for P2P GOAvraham Stern2015-10-141-7/+11
| | | | | | | | | | | CTWindow was set for all AP interfaces if the driver supports it and this parameter is set in wpa_supplicant configuration. This results in failing to start an AP that is not a P2P GO as this setting is rejected by the driver. Fix that by setting the CTWindow only for P2P GO interface. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* P2P: Implement wpas_p2p_move_go_csa()Andrei Otcheretianski2015-10-031-11/+15
| | | | | | | | | Use channel switch mechanism to move a P2P GO to a new channel, when required. In order to be able to reconfigure the GO channel, split wpa_supplicant_conf_ap() function, so the frequency configuration part can be reused to find additional CSA settings. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* wpa_supplicant: Fix channel switch notification with VHTAndrei Otcheretianski2015-09-251-1/+2
| | | | | | | Fix a bug in wpas_ap_ch_switch() function, which didn't pass VHT frequencies correctly to hostapd_event_ch_switch(). Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* Update wpa_s->current_ssid->frequency on CS eventAndrei Otcheretianski2015-09-251-0/+2
| | | | | | Update wpa_s->current_ssid->frequency when EVENT_CH_SWITCH is received. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* Add shared periodic cleanup function for AP modeJouni Malinen2015-07-201-0/+7
| | | | | | | | | This new mechanism can be used to combine multiple periodic AP (including P2P GO) task into a single eloop timeout to minimize number of wakeups for the process. hostapd gets its own periodic caller and wpa_supplicant uses the previously added timer to trigger these calls. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Do not allow 40 MHz co-ex PRI/SEC switch to force MCCJouni Malinen2015-06-281-0/+23
| | | | | | | | | | Do not allow 40 MHz co-ex PRI/SEC switch to force us to change our PRI channel if we have an existing connection on the selected PRI channel since doing multi-channel concurrency is likely to cause more harm than using different PRI/SEC selection in environment with multiple BSSes on these two channels with mixed 20 MHz or PRI channel selection. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Specify frequency when sending Probe Response frameAndrei Otcheretianski2015-06-141-1/+6
| | | | | | | | | | If the RX frequency of the Probe Request frame is known, specify it when sending the Probe Response frame. This is needed when the Probe Request frame is received on another virtual interface, for example, when a GO or P2PS client are discoverable on the group operating channel. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Add rx_freq parameter to Probe Request frame handlerMax Stepanov2015-06-141-1/+1
| | | | | | | | | | | 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>
* Fix CONFIG_AP=y build without CONFIG_CTRL_IFACEJouni Malinen2015-04-041-0/+4
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* Send CTRL-EVENT-DISCONNECTED on wpa_supplicant AP deinitJouni Malinen2015-03-141-0/+3
| | | | | | | | This makes the AP mode more consistent with other modes by providing a matching pair of CTRL-EVENT-CONNECTED and CTRL-EVENT-DISCONNECTED event messages. Signed-off-by: Jouni Malinen <j@w1.fi>
* DFS: Allow wpa_supplicant AP mode to use non-offloaded DFSJouni Malinen2015-03-051-0/+10
| | | | | | | This extends the hostapd-like setup of DFS-in-userspace for wpa_supplicant AP mode operations. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* DFS: wpa_supplicant event processingAhmad Kholaif2015-03-051-0/+64
| | | | | | | | Add radar event processing logic for AP/P2P GO. The DFS processing functions from hostapd are now used for these wpa_supplicant cases as well for both offloaded and non-offloaded DFS. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow configuring CTWindow when working as GOEliad Peller2015-02-211-0/+11
| | | | | | | | | Read p2p_go_ctwindow (0-127 TUs) from the config file, and pass it to the driver on GO start. Use p2p_go_ctwindow=0 (no CTWindow) by default. Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
* Add STOP_AP control interface commandJouni Malinen2015-02-081-0/+11
| | | | | | | This is mainly for testing purposes to allow beaconing to be stopped without clearing AP state in hostapd. Signed-off-by: Jouni Malinen <j@w1.fi>
* AP: Enable HT Tx STBC for AP/GO if supported by driverEyal Shapira2015-01-191-0/+1
| | | | | | | Publish support for Tx STBC in the HT capabilities of a GO and AP controlled by wpa_supplicant in case the hardware supports it. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
* Clear wpa_psk memory when setting up wpa_supplicant AP modeJouni Malinen2014-12-291-1/+1
| | | | | | | | | This is more of a theoretical case since this part is done only during setup and the structure is not allocated in practice. Anyway, maintaining more consistent use of bin_clear_free() for structures that may contain keys is useful. Signed-off-by: Jouni Malinen <j@w1.fi>
* Extend wpa_supplicant STA* ctrl_iface commands for meshJouni Malinen2014-12-141-9/+24
| | | | | | | | Since mesh functionality uses struct hostapd_data to maintain peer state, the existing STA* control interface commands can be used to display information about the peers. Signed-off-by: Jouni Malinen <j@w1.fi>
* Check os_snprintf() result more consistently - more checksJouni Malinen2014-12-081-1/+6
| | | | | | Add more os_snprintf() result validation checks. Signed-off-by: Jouni Malinen <j@w1.fi>
* Check os_snprintf() result more consistently - automatic 1Jouni Malinen2014-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts os_snprintf() result validation cases to use os_snprintf_error() where the exact rule used in os_snprintf_error() was used. These changes were done automatically with spatch using the following semantic patch: @@ identifier E1; expression E2,E3,E4,E5,E6; statement S1; @@ ( E1 = os_snprintf(E2, E3, ...); | int E1 = os_snprintf(E2, E3, ...); | if (E5) E1 = os_snprintf(E2, E3, ...); else E1 = os_snprintf(E2, E3, ...); | if (E5) E1 = os_snprintf(E2, E3, ...); else if (E6) E1 = os_snprintf(E2, E3, ...); else E1 = 0; | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else { ... return -1; } | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else if (E6) { ... E1 = os_snprintf(E2, E3, ...); } else { ... return -1; } | if (E5) { ... E1 = os_snprintf(E2, E3, ...); } else { ... E1 = os_snprintf(E2, E3, ...); } ) ? os_free(E4); - if (E1 < 0 || \( E1 >= E3 \| (size_t) E1 >= E3 \| (unsigned int) E1 >= E3 \| E1 >= (int) E3 \)) + if (os_snprintf_error(E3, E1)) ( S1 | { ... } ) Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Enable mesh HT modeJason Mobarak2014-11-161-17/+25
| | | | | | | | | | | | Add a new option "mesh_ht_mode" that specifies the HT mode for the mesh, with this option on, mesh beacons, actions frames, and probe responses with include the appropriate HT information elements. [original implementation by Chun-Yeow Yeoh <yeohchunyeow@gmail.com>] [some fixes by Masashi Honma <masashi.honma@gmail.com>] Signed-off-by: Ashok Nagarajan <ashok.dragon@gmail.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
* P2P: Support GCMP as part of 60 GHz supportAhmad Masri2014-10-271-1/+2
| | | | Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* HT: Let the driver advertise its supported SMPS modes for AP modeEliad Peller2014-10-231-0/+1
| | | | | | | | Add smps_modes field, and let the driver fill it with its supported SMPS modes (static/dynamic). This will let us start an AP with specific SMPS mode (e.g., dynamic) that will allow it to reduce its power usage. Signed-off-by: Eliad Peller <eliad@wizery.com>
* Add external EAPOL transmission option for testing purposesJouni Malinen2014-10-101-0/+4
| | | | | | | | | | The new ext_eapol_frame_io parameter can be used to configure hostapd and wpa_supplicant to use control interface for receiving and transmitting EAPOL frames. This makes it easier to implement automated test cases for protocol testing. This functionality is included only in CONFIG_TESTING_OPTIONS=y builds. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_supplicant: Use hostapd_freq_params in assoc_paramsJanusz Dziedzic2014-10-041-1/+1
| | | | | | | | Use hostapd_freq_params instead of simple frequency parameter for driver commands. This is preparation for IBSS configuration to allow use of HT/VHT in IBSS. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
* P2P: Clean up by moving ifdef CONFIG_P2P to p2p_suppplicant.hJouni Malinen2014-06-151-11/+1
| | | | | | | | This removes number of unnecessary #ifdef CONFIG_P2P blocks from generic code by hiding the conditional build into p2p_supplicant.h with empty inline functions. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Use cleaner way of generating pointer to a field (CID 68096)Jouni Malinen2014-06-121-5/+3
| | | | | | | | The Action code field is in a fixed location, so the IEEE80211_HDRLEN can be used here to clean up bounds checking to avoid false reports from static analyzer. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Use cleaner way of generating pointer to a field (CID 68095)Jouni Malinen2014-06-121-5/+3
| | | | | | | | The Action code field is in a fixed location, so the IEEE80211_HDRLEN can be used here to clean up bounds checking to avoid false reports from static analyzer. Signed-off-by: Jouni Malinen <j@w1.fi>
* Fix CONFIG_AP=y build without CONFIG_P2P=yJouni Malinen2014-04-071-0/+5
| | | | | | | Commit ca9bc5b5666a08c741ddd21c451ecb92aa33a11a used P2P functionality from ap.c without proper ifdef CONFIG_P2P. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Enable WSC 2.0 support unconditionallyJouni Malinen2014-03-251-2/+0
| | | | | | | | | There is not much point in building devices with WPS 1.0 only supported nowadays. As such, there is not sufficient justification for maintaining extra complexity for the CONFIG_WPS2 build option either. Remove this by enabling WSC 2.0 support unconditionally. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_supplicant AP: Allow PMF to be enabled with ieee80211wJouni Malinen2014-03-131-0/+5
| | | | | | | | | The ieee80211w parameter was not previously copied to the hostapd BSS structure from wpa_supplicant configuration, so PMF was practically disabled. Allow it to be configured through the wpa_supplicant network configuration block. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* AP/GO interface teardown optimizationMoshe Benji2014-03-051-0/+3
| | | | | | | | | | | | | | | This commit adds an option to optimize AP teardown by leaving the deletion of keys (including group keys) and stations to the driver. This optimization option should be used if the driver supports stations and keys removal when stopping an AP. For example, the optimization option will always be used for cfg80211 drivers since cfg80211 shall always remove stations and keys when stopping an AP (in order to support cases where the AP is disabled without the knowledge of wpa_supplicant/hostapd). Signed-off-by: Moshe Benji <moshe.benji@intel.com>
* P2P: Enable U-APSD support on GO automaticallyJouni Malinen2014-02-171-0/+2
| | | | | | | | | Since P2P specification mandates P2P GO to support WMM-PS with legacy STAs, enable this automatically if the driver indicates support for U-APSD in AP mode. The "P2P_SET go_apsd 0" command can still be used to disable this if needed. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Remove dead code from AP setupJouni Malinen2014-02-041-6/+2
| | | | | | | wpa_supplicant_create_ap() is only called for AP mode, so there is no point in trying to address station (infra/IBSS) modes. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>