Jouni Malinen [Sun, 31 Mar 2013 14:15:39 +0000 (17:15 +0300)]
WPS: Use latest updated BSS entry if multiple BSSID matches found
If the AP (P2P GO) has changes its channel of SSID recently, the BSS
table may have multiple entries for a BSSID. Select the one which was
most recently updated for WPS/P2P operations in such case to increase
the likelihood of using current information.
Jouni Malinen [Sun, 31 Mar 2013 13:22:28 +0000 (16:22 +0300)]
tests: Use a single set of scripts for running both P2P and AP tests
This removes the unnecessary separation of P2P (no hostapd) and AP
tests. The same scripts can be used to prepare for these tests and to
execute the tests.
Jouni Malinen [Sun, 31 Mar 2013 08:48:52 +0000 (11:48 +0300)]
WPS: Allow hostapd process to control independent WPS interfaces
The new wps_independent=1 configuration parameter can be used to remove
interfaces from the shared hostapd process WPS control (i.e., to apply
WPS operations only to a subset of interfaces instead of all).
Jouni Malinen [Sun, 31 Mar 2013 08:26:29 +0000 (11:26 +0300)]
WPS AP: Add support for reconfiguration with in-memory config
This allows WPS to update AP configuration in the case no hostapd
configuration file is used (i.e., dynamic configuration through the
control interface).
Johannes Berg [Sat, 30 Mar 2013 18:37:44 +0000 (20:37 +0200)]
nl80211: Use nla_nest_start/end instead of nla_put_nested
Instead of allocating a new message and then moving that into
the message being built, use nla_nest_start() and put the data
into the message directly.
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
Jouni Malinen [Sat, 30 Mar 2013 18:31:22 +0000 (20:31 +0200)]
tests: Fix test_discovery to force full device discovery
P2P_PROV_DISC fails if the peer is not fully discovered and the previous
version of the test cases did not force this (i.e., it could have
started PD just based on having seen a Probe Request frame from the
peer).
Michael Braun [Sat, 30 Mar 2013 17:53:22 +0000 (19:53 +0200)]
AP: Fix infinite loop in WPA state machine when out of random bytes
When the OS is out of random bytes in SM_STATE(WPA_PTK, AUTHENTICATION2)
in ap/wpa_auth.c, hostapd sends the sm to state DISCONNECT without
clearing ReAuthenticationRequest, resulting in an infinite loop.
Clearing sm->ReAuthenticationRequest using gdb fixes the running hostapd
instance for me. Also sm->Disconnect = TRUE should be used instead of
wpa_sta_disconnect() to make sure that the incomplete ANonce does not
get used.
Fix this issue by resetting sm->ReAuthenticationRequest even if the STA
gets disconnected and use sm->Disconnect instead of
wpa_sta_disconnect().
Signed-hostap: Michael Braun <michael-dev@fami-braun.de>
Jouni Malinen [Sat, 30 Mar 2013 16:05:18 +0000 (18:05 +0200)]
Fix OLBC non-HT AP detection to check channel
A non-HT capable AP on any channel could have triggered us to enable
protection regardless of own operating channel if the driver delivered
Beacon frames from other channels. The channel detection in ap_list is
not exactly ideal, but most cases can be handled by checking ap->channel
against the currently configured channel (or secondary channel in case
of HT40).
Jouni Malinen [Sat, 30 Mar 2013 14:10:43 +0000 (16:10 +0200)]
P2P: Fix provision discovery response handling in some cases
Commit 6b56cc2d97fe9efd1feea8d418714b4658b056f1 added a possible call to
p2p_reset_pending_pd() prior to checking config_methods match between
our request and peer response. That reset call could clear
dev->req_config_methods and as such, result in unexpected
P2P-PROV-DISC-FAILURE report here even in cases where the peer accepts
the provision discovery. Fix this by using a local copy of the
req_config_methods variable.
Jouni Malinen [Fri, 29 Mar 2013 15:09:31 +0000 (17:09 +0200)]
hostapd: Allow ctrl_iface group to be specified on command line
The new -G<group> command line argument can now be used to set the group
for the control interfaces to enable cases where hostapd is used without
a configuration file and the controlling program is not running with
root user privileges.
Sunil Dutt [Thu, 28 Mar 2013 13:05:10 +0000 (15:05 +0200)]
TDLS: Support both external and internal setup in disabling link
Enhance TDLS Setup Request processing to support both external and
internal TDLS setup for the case where concurrent TDLS initialization
results in the TDLS Setup Request from the peer getting accepted.
Jouni Malinen [Thu, 28 Mar 2013 10:38:24 +0000 (12:38 +0200)]
TDLS: Fix TDLS Setup Request processing in existing-peer cases
wpa_tdls_peer_free() ended up getting called after some of the
parameters from the TDLS Setup Request frame were copied into the struct
wpa_tdls_peer information. This could result in continuing with cleared
information in case the new exchange was the one that is used in
concurrent initialization case or if this is to re-negotiated an
existing TDLS link. The driver would not be provided with all the peer
capabilities correctly in such case.
Fix this by moving the existing_peer check to happen before the
information from the TDLS Setup Request frame is copied.
Vivek Natarajan [Mon, 25 Mar 2013 22:28:56 +0000 (00:28 +0200)]
P2P: Ignore Tx acknowledgment status for Invitation Response
In some cases where the ack for Invitation response is lost,
the device is stuck in invited state but the peer device starts
GO. In line with the implementation of Negotiation Confirm,
assume invitation response was actually received by the peer
even though ack was not reported.
Jouni Malinen [Thu, 21 Mar 2013 13:52:41 +0000 (15:52 +0200)]
Add ap_vendor_elements for wpa_supplicant AP/P2P GO mode
This new parameter allows wpa_supplicant AP mode operations to use
similar design to the vendor_elements parameter in hostapd to add
vendor_elements into Beacon/Probe Response IE parameters.
Jouni Malinen [Thu, 21 Mar 2013 13:41:27 +0000 (15:41 +0200)]
Add vendor_elements into Beacon/Probe Response IE parameters
Commit b52f084cfaae5a10bf5886cfa159d2df0dfc350a introduced a mechanism
for adding arbitrary vendor-specific elements into the Beacon and Probe
Response frames. However, this information was not added to the separate
buffers used for specifying Beacon and Probe Response IEs for drivers
that build the frames internally. Add vendor_elements to these values,
too, to support such drivers in addition to drivers that use the full
Beacon tail/head buffers.
Jouni Malinen [Tue, 19 Mar 2013 08:58:28 +0000 (10:58 +0200)]
tests: Add concurrent version of P2P test setup
A virtual station interface in scanning state can change the P2P
operations quite a bit, so running all the P2P tests also in such
setup can increase testing coverage quite a bit.
Johannes Berg [Tue, 19 Mar 2013 00:01:46 +0000 (02:01 +0200)]
nl80211: Fix mode settings with split wiphy dump
When the wiphy information is split, there's no guarantee that the
channels are processed before the bitrates; in fact, with the current
kernel it happens the other way around. Therefore, the mode information
isn't set up correctly and there's no 11g mode.
Fix this by doing the 11b/11g determination as part of the
postprocessing.
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
Jouni Malinen [Mon, 18 Mar 2013 23:53:09 +0000 (01:53 +0200)]
wpaspy: Add native Python implementation of ctrl_iface access
This can be used as a replacement for the wpaspy.c module that uses
wpa_ctrl.c to access wpa_supplicant/hostapd control interface. Only
the UNIX domain socket version of the control interface is currently
supported.
Jouni Malinen [Mon, 18 Mar 2013 18:31:47 +0000 (20:31 +0200)]
P2P: Stop P2P_PD_DURING_FIND wait on PD Response RX
Previously, P2P_PD_DURING_FIND state was scheduled for 200 ms and the
P2P state was not change until that timeout regardless of whether the PD
Response for recieved or not. There is no need to wait for that timeout
if the response is received, so allow the next operation to be performed
immediately after the response has been processed.
Jouni Malinen [Mon, 18 Mar 2013 15:36:12 +0000 (17:36 +0200)]
tests: Use social channel scan to speed up tests
The discovery and group formation test cases do not need to run the full
scan as the first step, so get rid of it to make the tests complete more
quickly.
Jouni Malinen [Mon, 18 Mar 2013 15:11:15 +0000 (17:11 +0200)]
P2P: Postpone P2P scan only if station mode scan is pending
sta_scan_pending was supposed to be accurate enough for determining
whether a P2P scan needs to be postponed. However, it has turned out
that there were cases where sta_scan_pending was not cleared properly.
While the known cases have now been addressed, it is possible that some
other cases may still exist. To avoid issues with P2P operationg getting
stuck, verify more carefully that there is a real pending station mode
scan (either in progress or scheduled to be requested).
Jouni Malinen [Mon, 18 Mar 2013 15:07:09 +0000 (17:07 +0200)]
Use special scan result processing steps only on requesting interface
Scan result events are shared between all virtual interfaces sharing the
same radio. However, some of the steps are not really appropriate on
virtual interfaces that did not issue the scan request. Fix this by
making these steps conditional on the scan results being processed on
the interface that requested them.
Jouni Malinen [Mon, 18 Mar 2013 15:04:23 +0000 (17:04 +0200)]
P2P: Re-start P2P operation if station mode scanning is stopped
There were couple of code paths that could end up stopping station mode
scanning without clearing sta_scan_pending. This could result in P2P
search getting stuck waiting for completion of station mode scan which
would never show up. Fix this by calling wpas_p2p_continue_after_scan()
in cases where station mode scans are stopped. This allows
sta_scan_pending to be cleared and P2P search operation continued.
Jouni Malinen [Mon, 18 Mar 2013 14:31:09 +0000 (16:31 +0200)]
P2P: Use common function for re-starting P2P scan after station scan
Make the implementation more consistent and cleaner by using a single
function for addressing all the cases where completion of a station mode
scan operation allows a P2P operation (search) to be re-started.
Jouni Malinen [Mon, 18 Mar 2013 14:05:24 +0000 (16:05 +0200)]
nl80211: Include interface name in more debug prints
This makes it easier to understand how scan operations and events occur
when multiple interfaces is being controlled by a single wpa_supplicant
process.
Jouni Malinen [Sun, 17 Mar 2013 18:13:46 +0000 (20:13 +0200)]
Android: Use CONFIG_WNM mode consistently
Replace CONFIG_IEEE80211V with CONFIG_WNM to get more consistent build
options for WNM-Sleep Mode operations. This is similar to the Makefile
change in commit ad3872a3720df13d8fc1a4345a5f0a8c3a204b4e.
Jouni Malinen [Sun, 17 Mar 2013 18:10:44 +0000 (20:10 +0200)]
Android: Fix CONFIG_WNM use in Android.mk
This code was within ifdef CONFIG_AP and did not get included unless
AP mode support was also enabled. This is similar to the Makefile
change in commit 2dfb9a447c7b71e03d4f4a318b4f8d67244d57d1.
This fixes the lookup of a usable PMKSA entry in the cache. Using
wpa_s->current_ssid often returns nothing when a usable PMKSA exists in
the cache since wpa_s->current_ssid does not necessarily point to the
correct network entry at this point in time (prior to association).
Jouni Malinen [Sat, 16 Mar 2013 09:36:59 +0000 (11:36 +0200)]
tests: Add GO Negotiation without pre-authorization
This is the most common sequence for initiating GO Negotiation, so
include a test case that uses threads to follow both peers at the
same time to allow GO Negotiation to be re-initiated.
Jouni Malinen [Fri, 15 Mar 2013 14:31:31 +0000 (16:31 +0200)]
P2P: Remove persistent group peer if it rejects invitation
If a peer replies to persistent group invitation with status code 8
(unknown group), remove the peer from the p2p_client_list if we are the
GO or remove the persistent group if we are the P2P client since it
looks like that the peer has dropped persistent group credentials and
the provisioning step needs to be executed again.
Jouni Malinen [Thu, 14 Mar 2013 14:32:35 +0000 (16:32 +0200)]
P2P: Allow shared interface channel preference to be ignored
p2p_ignore_shared_freq=1 in the configuration file (or "SET
p2p_ignore_shared_freq 1" on control interface) can now be used to
configure wpa_supplicant to ignore the preference on shared operating
channel when the driver support multi-channel concurrency. The default
behavior is to try to start any new P2P group on an operating channel
that is already in use on another virtual interface to avoid extra cost
from hopping between multiple channels. If this new parameter is set to
1, such preference is not used and instead, the channel for the new P2P
group is selected based on other preferences while ignoring operating
channels of any concurrent connection.
Jouni Malinen [Thu, 14 Mar 2013 14:22:31 +0000 (16:22 +0200)]
P2P: Fix shared frequency preference for concurrent operations
Commit 50285f5ca8086cca45afa42cd23c3a3c1cd58f40 changed number of rules
in channel selection and among other things, it broke the design where
the currently used operating channel on a virtual interface that is
shared by the same radio is preferred to avoid costs related to
multi-channel concurrency. Fix this regression by making the P2P module
aware of the shared channel and using that preference as the highest
priority when re-selecting the channel during negotiation.
Jouni Malinen [Thu, 14 Mar 2013 14:05:47 +0000 (16:05 +0200)]
P2P: Use best-overall channel in p2p_reselect_channel()
Commit 50285f5ca8086cca45afa42cd23c3a3c1cd58f40 ended up forcing channel
re-selection in number of cases where the peer would actually have
accepted our initial preference. Fix the parts related to best channel
information by using best_freq_overall as the highest priority and by
skipping the band changes if the peer supports the channel that we
picked since these were based on the assumption that
p2p_reselect_channel() is called only if the peer could not accept our
initial choice which is not the case anymore.
Jouni Malinen [Thu, 14 Mar 2013 13:38:11 +0000 (15:38 +0200)]
P2P: Allow all channels for multi-channel concurrency (no negotiation)
Commit 79879f4ae8f3eacee52699e3ccd5e0baba601c4d enabled all channels to
be used when negotiating channel with a driver that supports
multi-channel concurrency. Extend that to cover cases where the channel
is not being negotiated (e.g., p2p_group_add to start a GO).
Sunil Dutt [Thu, 14 Mar 2013 11:48:36 +0000 (13:48 +0200)]
TDLS: Disable link to existing peer with lower address
If the previously started setup is terminated in case both peers
initiate TDLS link at more or less the same time, disable the old link
to allow the dummy station entry to be deleted from cfg80211 so that a
new entry can be added for the setup direction that will be allowed to
proceed.
Jouni Malinen [Wed, 13 Mar 2013 10:38:26 +0000 (12:38 +0200)]
Fix compiler warning when CONFIG_IEEE80211R is not included
Commit 6a1ce39599c857e6e612d8dd81e892ec5ca36c7c moved the bssid
variable declaration to be outside CONFIG_IEEE80211R block and
triggered a compiler warning about unused variable.
Deepthi Gowri [Tue, 12 Mar 2013 18:08:53 +0000 (20:08 +0200)]
FT: Add support for IEEE 802.11r with driver-based SME
Add NL80211_CMD_UPDATE_FT_IES to support update of FT IEs to the
WLAN driver. Add NL80211_CMD_FT_EVENT to send FT event from the
WLAN driver. This will carry the target AP's MAC address along
with the relevant Information Elements. This event is used to
report received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE).
Jouni Malinen [Tue, 12 Mar 2013 11:04:33 +0000 (13:04 +0200)]
P2P: Add a peer entry based on Association Request frame
It is possible for a P2P client to connect to an operating group without
exchanging any Probe Request/Response frames that would allow the GO to
discover the peer. To make sure there is a P2P peer entry at the GO, try
to add the peer information based on P2P IE in (Re)Association Request
frame.
Vivek Natarajan [Mon, 11 Mar 2013 18:47:24 +0000 (20:47 +0200)]
P2P: Clear p2p_in_provisioning flag on group removal
Commit 77dfafd07d3a0335e250b8ffaf74fe7b3714b0bc cancels group formation
timeout on group removal case but failed to reset the
p2p_in_provisioning flag. This can lead to repeated p2p_find failures if
the group gets removed before completion of the WPS provisioning step
(e.g., GO tears down the group). Fix this by clearing
p2p_pin_provisioning when cancelling group formation.
Chet Lanctot [Mon, 11 Mar 2013 11:49:40 +0000 (13:49 +0200)]
Allow SME SA Query to be used by all drivers
The unprotected disconnection events were previously processed only for
drivers that used the wpa_supplicant SME implementation (separate
authentication and association commands). However, this can be useful
for drivers that use the connect API, so remove the limitation and allow
the same IEEE 802.11w SA Query mechanism to be used even without full
use of the wpa_supplicant SME.
Johannes Berg [Sun, 10 Mar 2013 16:04:39 +0000 (18:04 +0200)]
wpa_supplicant: Support VHT capability overrides
Add support for VHT capability overrides to allow testing connections
with a subset of the VHT capabilities that are actually supported by
the device. The only thing that isn't currently supported (by mac80211
and this code) is the RX/TX highest rate field.
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Sun, 10 Mar 2013 15:55:24 +0000 (17:55 +0200)]
wpa_supplicant: Parse int values in different bases and reject invalid
Instead of using atoi(), use strtol() which allows checking if
the configuration values are valid integers and can understand
more than just decimal (also hexadecimal and octal). This not
only allows specifying some fields in hex (which can be useful)
but also rejecting invalid configurations, e.g.,
disassoc_low_ack=27 * 2
which was previously read as just 27.
Signed-hostap: Johannes Berg <johannes.berg@intel.com>