mech_eap.git
11 years agoTDLS: Retry TDLS Setup Response more quickly
Sunil Dutt [Mon, 20 May 2013 10:07:24 +0000 (15:37 +0530)]
TDLS: Retry TDLS Setup Response more quickly

TDLS responder STA used to retransmit the TDLS Setup Response after 5
seconds if the TDLS Setup Confirm is not received. The initiator would
have enabled the TDLS link and started transmitting the data to the peer
on the TDLS link after transmitting the TDLS Setup Confirm frame. If the
TDLS Setup Confirm frame is not received by the receiver, the
transmissions from the initiator on the direct link would get failed for
the TDLS link not getting enabled on the receiver. This commit reduces
the data delivery failure duration by shortening the retry time of the
TDLS Setup Response frames. The retry limit of the TDLS Response frame
also is increased to ensure that the peer does not miss the frames in
the reduced time period.

Signed-hostap: Sunil Dutt <duttus@codeaurora.org>

11 years agoWNM: Add disassociation timeout processing for ESS_DISASSOC
Kyeyoon Park [Fri, 5 Apr 2013 15:41:26 +0000 (18:41 +0300)]
WNM: Add disassociation timeout processing for ESS_DISASSOC

The hostapd_cli ess_disassoc command now takes three arguments (STA MAC
address, timeout in ms, URL) and the STA is disconnected after the
specified timeout.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoGAS: Reduce query timeout to two seconds
Jouni Malinen [Sat, 20 Apr 2013 23:48:10 +0000 (16:48 -0700)]
GAS: Reduce query timeout to two seconds

The five second timeout for GAS queries is excessive and can result in
long waits in cases where APs are either misconfigured or frames are
lost.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoGAS: Assign new dialog token even if previous one is free
Jouni Malinen [Sun, 14 Apr 2013 20:23:50 +0000 (13:23 -0700)]
GAS: Assign new dialog token even if previous one is free

This makes the design more robust against unexpected duplicates since
each new GAS exchange gets a different dialog token compared to the
previous one.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoGAS: Ignore replays if previous frag_id without dropping GAS session
Jouni Malinen [Tue, 29 Jan 2013 15:33:34 +0000 (07:33 -0800)]
GAS: Ignore replays if previous frag_id without dropping GAS session

It looks like it may be possible for an older GAS response to get retransmitted
even after the first copy has been processed. While this should not really come
up all the way to wpa_supplicant due to sequence number being same (i.e.,
duplicate detection should from the frame), some cases have been observed where
this did cause issues. Drop such a frame silently without dropping the ongoing
GAS session to allow a frame with the next frag_id to be processed after this.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoAdd test code for fetching the last configured GTK
Jouni Malinen [Fri, 28 Oct 2011 11:39:44 +0000 (14:39 +0300)]
Add test code for fetching the last configured GTK

This can be useful for some test cases, so allow wpa_supplicant to be
built with special test functionality to expose the current (last
configured) GTK. This is disabled by default and can be enabled by
adding following line into .config:
CFLAGS += -DCONFIG_TESTING_GET_GTK

The GTK can then be fetched with "wpa_cli get gtk".

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoP2P: Direct global ctrl_iface commands automatically for P2P
Jouni Malinen [Sat, 18 May 2013 16:41:08 +0000 (19:41 +0300)]
P2P: Direct global ctrl_iface commands automatically for P2P

The P2P management operations like P2P_FIND and P2P_CONNECT are not
really specific to any network interface. These are P2P Device level
operations that are in more global device context. Allow those to be
sent through the global control interface without IFNAME parameter.

For now, these commands are directed within wpa_supplicant to the
network interface that initialized the global P2P context. This may
change in the future if a special context is added for P2P operations.
Anyway, such changes can now be done internally within wpa_supplicant
without affecting this global control interface design from external
view point.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoP2P: No duplicate AP-STA-CONNECTED/DISCONNECTED as global event
Jouni Malinen [Sat, 18 May 2013 16:18:31 +0000 (19:18 +0300)]
P2P: No duplicate AP-STA-CONNECTED/DISCONNECTED as global event

These events are sent as a special case to both the group interface and
"parent interface" (i.e., the interface that was used for managing P2P
negotiation). The latter is not really correct event, so get rid of it
with the new global control interface design where there is no need to
support legacy upper layer implementations.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoClean up AP-STA-CONNECTED/DISCONNECTED prints
Jouni Malinen [Sat, 18 May 2013 16:09:41 +0000 (19:09 +0300)]
Clean up AP-STA-CONNECTED/DISCONNECTED prints

Use shared code to print the parameters so that they do not need to be
generated four times separately.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoP2P: Mark P2P events global (not specific to interface)
Jouni Malinen [Sat, 18 May 2013 15:59:51 +0000 (18:59 +0300)]
P2P: Mark P2P events global (not specific to interface)

This removes the "IFNAME=<ifname> " prefix from P2P events that are
received through the global control interface since these events are not
really specific to any network interface, but the full device.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoP2P: Clean up debug prints
Jouni Malinen [Sat, 18 May 2013 15:47:36 +0000 (18:47 +0300)]
P2P: Clean up debug prints

Replace direct wpa_msg() calls with p2p_dbg(), p2p_info(), and p2p_err()
calls that use a new debug_print() callback to handle actual debug
printing outside the P2P module.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoP2P: Move p2p_find stopped event message into p2p_supplicant.c
Jouni Malinen [Sat, 18 May 2013 13:06:40 +0000 (16:06 +0300)]
P2P: Move p2p_find stopped event message into p2p_supplicant.c

This removes wpa_ctrl.h dependency from src/p2p/* and makes the P2P
events more consistent, i.e., everything that is aimed for upper layer
processing from the wpa_supplicant control interfaces is generated in
p2p_supplicant.c.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoAdd wpa_msg_global() for global events
Jouni Malinen [Sat, 18 May 2013 11:19:24 +0000 (14:19 +0300)]
Add wpa_msg_global() for global events

This function can be used instead of wpa_msg() and wpa_msg_ctrl() to
indicate that an event is not specific to a network interface.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoAllow global ctrl_iface monitors
Jouni Malinen [Sat, 18 May 2013 11:07:28 +0000 (14:07 +0300)]
Allow global ctrl_iface monitors

The ATTACH/DETACH mechanism to request event messages from
wpa_supplicant can now be used through the global control interface,
too. This results in events from all interfaces being delivered through
a single monitor socket. "IFNAME=<ifname> " prefix is used on events
that are specific to an interface.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpa_cli: Set buffer length the same as in wpa_supplicant_ctrl_iface_process()
Dmitry Shmidt [Tue, 30 Aug 2011 18:10:13 +0000 (11:10 -0700)]
wpa_cli: Set buffer length the same as in wpa_supplicant_ctrl_iface_process()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoAdd band option (2.4 vs. 5) for filtering scans
Jouni Malinen [Fri, 9 Mar 2012 05:28:13 +0000 (21:28 -0800)]
Add band option (2.4 vs. 5) for filtering scans

This can be used to implement filtering of channels for scan and based
on that, for connection, purposes.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoAndroid: Clarify keystore include directories
Jouni Malinen [Sat, 18 May 2013 09:03:35 +0000 (12:03 +0300)]
Android: Clarify keystore include directories

This updates hostapd to build using the new keystore header file
location and adds a note that the old frameworks/base/cmds/keystore can
be removed at some point in the future when old Android releases do not
need to be supported.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoAndroid: Add a top level Android.mk
Jouni Malinen [Sat, 18 May 2013 08:55:32 +0000 (11:55 +0300)]
Android: Add a top level Android.mk

This allows the hostap.git repository version to be build as part of the
full Android platform build.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoAbstract and Android sockets for global ctrl_iface
Jouni Malinen [Sat, 18 May 2013 08:42:09 +0000 (11:42 +0300)]
Abstract and Android sockets for global ctrl_iface

The wpa_supplicant global control interface parameter can now be used to
explicitly specify an abstract UNIX domain socket (Linux specific
extension) with "@abstract:" prefix and an Android control socket with
"@android:" prefix.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpa_cli: Allow global interface to be used in interactive mode
Jouni Malinen [Sat, 18 May 2013 08:40:23 +0000 (11:40 +0300)]
wpa_cli: Allow global interface to be used in interactive mode

This is mostly a corner case at this point, but if wpa_cli was started
with global control interface connection (-g) and interactive mode,
per-interface control interface was tried to be opened with the
previously opened global ctrl_iface connection gettign leaked.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpa_supplicant: Add -G argument to specify global ctrl group
Jouni Malinen [Sat, 18 May 2013 08:00:05 +0000 (11:00 +0300)]
wpa_supplicant: Add -G argument to specify global ctrl group

The optional -G<group> command line argument can be used to specify the
group that can access the global control interface.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoAllow global ctrl_iface to be used for per-interface commands
Jouni Malinen [Sat, 18 May 2013 07:19:38 +0000 (10:19 +0300)]
Allow global ctrl_iface to be used for per-interface commands

"IFNAME=<ifname> " prefix can now be used on the wpa_supplicant global
control interface to direct a command to a specific interface instead of
having to use an interface specific control interface for this. This
allows a single socket to be used for controlling multiple virtual
interfaces.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoFT RRB: Fix a memory leak on error path
Jouni Malinen [Sat, 18 May 2013 06:49:26 +0000 (09:49 +0300)]
FT RRB: Fix a memory leak on error path

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoP2P: Use preferred channel list during GO creation
Suryadevara Sudheer [Fri, 17 May 2013 08:27:02 +0000 (11:27 +0300)]
P2P: Use preferred channel list during GO creation

This extends support for p2p_pref_Chan configuration parameter for
autonomous GO creation.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoP2P: Re-select channel in invitation case with peer info
Suryadevara Sudheer [Fri, 17 May 2013 08:18:02 +0000 (11:18 +0300)]
P2P: Re-select channel in invitation case with peer info

Allow invitation exchange to update operating channel selection after
peer channel list has been received similarly to how GO negotiation was
handled.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoP2P: Fix p2p_pref_chan setting from configuration file
Yufeng Wang [Fri, 17 May 2013 08:03:52 +0000 (11:03 +0300)]
P2P: Fix p2p_pref_chan setting from configuration file

Commit 21d996f775a2131bb0c73d6e18ca9b382f017057 added p2p_pref_chan as a
configuration file parameter, but included only the case of dynamically
setting this at runtime through the control interface SET command.
Complete this functionality by taking this value into use directly from
the configuration file, too.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agodbus: Terminate cleanly on messagebus shutdown
Daniel Gnoutcheff [Thu, 16 May 2013 17:47:28 +0000 (20:47 +0300)]
dbus: Terminate cleanly on messagebus shutdown

By default, dbus_connection_dispatch() will call _exit() if the bus
connection has been closed. This caused wpa_supplicant to terminate
without properly cleaning up after itself.

To ensure that we terminate cleanly when the messagebus terminates,
override the exit_on_disconnect behavior and install a filter to handle
libdbus's "Disconnected" signal.

[Bug 474]

Signed-hostap: Daniel Gnoutcheff <daniel@gnoutcheff.name>

11 years agoWNM: Enable CONFIG_WNM in Android.mk
Vinayak Kamath [Thu, 16 May 2013 14:51:18 +0000 (17:51 +0300)]
WNM: Enable CONFIG_WNM in Android.mk

Signed-hostap: Vinayak Kamath <vkamat@codeaurora.org>

11 years agoWNM: Add sending of BSS Transition Management Query
Vinayak Kamath [Thu, 16 May 2013 14:50:31 +0000 (17:50 +0300)]
WNM: Add sending of BSS Transition Management Query

The new control interface command can be used to send a
BSS Transition Management Query frame to the current AP.

Signed-hostap: Vinayak Kamath <vkamat@codeaurora.org>

11 years agoWNM: Add neighbor report processing for BSS Transition Management
Vinayak Kamath [Thu, 16 May 2013 14:48:59 +0000 (17:48 +0300)]
WNM: Add neighbor report processing for BSS Transition Management

Process the neighbor report received in BSS Management Request frames.

Signed-hostap: Vinayak Kamath <vkamat@codeaurora.org>

11 years agoWPS: Clear connection failure counts on WPS success
Jouni Malinen [Wed, 15 May 2013 14:33:50 +0000 (17:33 +0300)]
WPS: Clear connection failure counts on WPS success

The WPS provisioning case does not result in successful connection by
design and as such, this can result in networks getting temporarily
disabled. Avoid this by clearing the failure counts on WPS success.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoWPS NFC: Connect using learnt credential after NFC Tag read
Jouni Malinen [Wed, 15 May 2013 13:46:45 +0000 (16:46 +0300)]
WPS NFC: Connect using learnt credential after NFC Tag read

Instead of just adding the new network, prefer the network learnt from a
configuration token during the first connection attempt. This makes the
WPS NFC case behave similarly to the in-band provisioning cases if there
are more preferred networks in the scan results.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoedit: Fix libreadline history clearing with WPA_TRACE
Jouni Malinen [Tue, 14 May 2013 13:46:38 +0000 (16:46 +0300)]
edit: Fix libreadline history clearing with WPA_TRACE

The HIST_ENTRY and its variables are allocated within libreadline, so
they won't have the WPA_TRACE special header and cannot be freed with
os_free(). Use free() to avoid issues during wpa_cli termination if any
of the new commands added to the history are to be removed (e.g.,
set_network could include a password).

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agonl80211: Fix foreign address filtering for MLME frame events
Jouni Malinen [Mon, 13 May 2013 08:53:21 +0000 (11:53 +0300)]
nl80211: Fix foreign address filtering for MLME frame events

Commit 97279d8d1ad40bd7d884af8e2fc26dff0163331a started filtering MLME
frame events based on Address 1 (destination) field. This works fine for
frames sent to us, but it did filter out some corner cases where we
actually want to process an event based on a frame sent by us. The main
such case is deauthentication or disassociation triggered by something
external to wpa_supplicant in the system. Fix this by accepting events
for frames where either Address 1 or 2 (transmitter) matches the
interface address.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpadebug: Add broadcast intent receiver for Wi-Fi events
Jouni Malinen [Sun, 12 May 2013 18:06:59 +0000 (21:06 +0300)]
wpadebug: Add broadcast intent receiver for Wi-Fi events

This makes it easier to debug Android framework actions with all the
related broadcast intents being logged.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoMark interface disconnected on removal request
Jouni Malinen [Sun, 12 May 2013 16:16:35 +0000 (19:16 +0300)]
Mark interface disconnected on removal request

This cleans up debug log by not trying to process the disconnection
event as a failure that could result in blacklist addition and auto
connect attempt. These are pointless operations since the interface is
going to removed immediately after this.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoDo not try auto connect mechanism in disconnected state
Jouni Malinen [Sun, 12 May 2013 16:15:33 +0000 (19:15 +0300)]
Do not try auto connect mechanism in disconnected state

This cleans up debug log by not requesting the auto connect on
dissassociation event if we are already in disconnected state and would
not try to connect anyway.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoDo not add BSS to blacklist on local disconnection request
Jouni Malinen [Sun, 12 May 2013 16:12:29 +0000 (19:12 +0300)]
Do not add BSS to blacklist on local disconnection request

There is no point in marking a BSS temporarily blacklisted based on a
connection failure or disconnection case if that happens as a result of
a local request to disconnect. The blacklist entry could result on
unexpected BSS getting selected on the next connection attempt. In
addition, the code to try to find another BSS within the ESS could
result in scanning a single channel on the next attempt. Fix these
issues by handling the connection failure events only if we are not in
disconnected state (i.e., would try to reconnect after this
automatically).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agowpadebug: Add a simple WebView activity
Jouni Malinen [Sat, 11 May 2013 18:01:46 +0000 (21:01 +0300)]
wpadebug: Add a simple WebView activity

This provides a simple web browser that can be started and stopped from
other apps or native applications.

This activity can be started with the following command:
am start -a android.action.MAIN -c android.intent.category.LAUNCHER \
    -n w1.fi.wpadebug/.WpaWebViewActivity -e w1.fi.wpadebug.URL <URL>

If <URL> is set to FINISH the activity is finished.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agotests: Allow hwsim_test and wlantest_cli to be used from PATH
Jouni Malinen [Sat, 11 May 2013 08:34:49 +0000 (11:34 +0300)]
tests: Allow hwsim_test and wlantest_cli to be used from PATH

This makes it easier to support some test environments where the
repository is shared between hosts.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpadebug: Add forgotten installation step to documentation
Jouni Malinen [Sat, 11 May 2013 08:32:03 +0000 (11:32 +0300)]
wpadebug: Add forgotten installation step to documentation

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agotests: Use /var/run/hostapd-global to avoid socket file in work dir
Jouni Malinen [Fri, 10 May 2013 14:09:55 +0000 (17:09 +0300)]
tests: Use /var/run/hostapd-global to avoid socket file in work dir

This makes some cases more convenient with read-only file systems.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoDefer scan if connection is in progress on any of the shared interfaces
Deepthi Gowri [Fri, 10 May 2013 13:10:50 +0000 (16:10 +0300)]
Defer scan if connection is in progress on any of the shared interfaces

Scanning can delay concurrent operations considerably, so it is better
to avoid that while trying to connect on any of the virtual interfaces
that share the same radio.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agotls_openssl: Store TLS context per-connection
Paul Stewart [Thu, 9 May 2013 21:22:08 +0000 (00:22 +0300)]
tls_openssl: Store TLS context per-connection

Store context for each tls_init() caller, so events are generated for
the correct wpa_s instance. The tls_global variable is retained for
older OpenSSL implementations that may not have app-data for SSL_CTX.

Signed-hostap: Paul Stewart <pstew@chromium.org>

11 years agoRename hostapd_parse_rates() to a more generic int list parser
Simon Wunderlich [Thu, 9 May 2013 17:21:41 +0000 (20:21 +0300)]
Rename hostapd_parse_rates() to a more generic int list parser

This can be used with other integer lists than just rates.

Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>

11 years agoDFS: Add ieee80211h hostapd configuration parameter
Simon Wunderlich [Thu, 9 May 2013 17:14:53 +0000 (20:14 +0300)]
DFS: Add ieee80211h hostapd configuration parameter

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>

11 years agonl80211: Add driver_ops for stopping AP beaconing
Simon Wunderlich [Thu, 9 May 2013 17:06:33 +0000 (20:06 +0300)]
nl80211: Add driver_ops for stopping AP beaconing

This can be used to stop AP mode beaconing temporarily, e.g., in
response to a radar detected event.

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>

11 years agonl80211: Add driver_ops for starting radar detection
Simon Wunderlich [Thu, 9 May 2013 17:05:01 +0000 (20:05 +0300)]
nl80211: Add driver_ops for starting radar detection

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>

11 years agonl80211: Add channel flags for DFS state information
Simon Wunderlich [Thu, 9 May 2013 17:02:57 +0000 (20:02 +0300)]
nl80211: Add channel flags for DFS state information

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>

11 years agonl80211: Add driver capability flag for radar detection
Simon Wunderlich [Thu, 9 May 2013 16:58:55 +0000 (19:58 +0300)]
nl80211: Add driver capability flag for radar detection

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>

11 years agonl80211: Add driver events for radar detection
Simon Wunderlich [Thu, 9 May 2013 16:54:18 +0000 (19:54 +0300)]
nl80211: Add driver events for radar detection

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>

11 years agoeloop: Allow to run event loop multiple times in a row
Simon Wunderlich [Thu, 9 May 2013 13:42:14 +0000 (16:42 +0300)]
eloop: Allow to run event loop multiple times in a row

DFS implementation requires to run an eventloop while monitoring
the Channel Availability Check (CAC). After that, the "real" event
loop is started, and should not fail doing so.

Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>

11 years agowpa_supplicant: Allow vifs to scan only current channel
Ben Greear [Thu, 9 May 2013 09:43:40 +0000 (12:43 +0300)]
wpa_supplicant: Allow vifs to scan only current channel

If a VIF is already associated, then only scan on the associated
frequency if user requests such. This is a big help when using
lots of virtual stations.

Signed-hostap: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
11 years agosystemd: Fix systemd interface alias
Arend van Spriel [Thu, 9 May 2013 08:25:48 +0000 (11:25 +0300)]
systemd: Fix systemd interface alias

In the systemd interface templated the alias entry was specified
with wlan0 hard coded. Changing it to %i in this patch. [Bug 477]

Reported-by: zg <ml@mail.tsaitgaist.info>
Signed-hostap: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
11 years agoTry to set WPA-None key after IBSS-joined event
Jouni Malinen [Tue, 7 May 2013 15:14:56 +0000 (18:14 +0300)]
Try to set WPA-None key after IBSS-joined event

cfg80211 rejects the set_key operations before the IBSS network has been
fully formed, so add one more attempt to set the key for WPA-None at
IBSS joined driver event.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoUse cached driver capabilities instead of new fetch for each operation
Jouni Malinen [Tue, 7 May 2013 14:36:40 +0000 (17:36 +0300)]
Use cached driver capabilities instead of new fetch for each operation

There is no need to repeat the driver capability fetch for each
operation since we already cache driver flags in wpa_s->drv_flags.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoTDLS: Do not overwrite the reason code in the Tear Down Request
Sunil Dutt [Tue, 7 May 2013 13:27:31 +0000 (16:27 +0300)]
TDLS: Do not overwrite the reason code in the Tear Down Request

The reason code for the teardown request is overwritten for open
mode. This commit removes the code that does so by reverting parts
of commit 0cb12963b69abf493e456c8b2ed2b0be30ce11e7.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoAdd a configration parameter for sched_scan interval
Sheng Fang [Tue, 7 May 2013 09:41:14 +0000 (12:41 +0300)]
Add a configration parameter for sched_scan interval

The new sched_scan_interval parameter can be used to set the default
sched_scan interval, e.g., for power saving purposes.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoSynchronize with wireless-testing.git include/uapi/linux/nl80211.h
Jouni Malinen [Mon, 6 May 2013 12:59:49 +0000 (15:59 +0300)]
Synchronize with wireless-testing.git include/uapi/linux/nl80211.h

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoTDLS: Move AID=1 workaround into driver_nl80211.c
Jouni Malinen [Mon, 6 May 2013 12:57:03 +0000 (15:57 +0300)]
TDLS: Move AID=1 workaround into driver_nl80211.c

The use of AID=1 for the nl80211 dummy STA case is specific to the
driver (cfg80211), so better move this into the driver wrapper instead
of generic TDLS implementation.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoTDLS: Pass peer's AID information to kernel
Sunil Dutt [Mon, 6 May 2013 12:47:44 +0000 (15:47 +0300)]
TDLS: Pass peer's AID information to kernel

The information of the peer's AID is required for the driver to
construct partial AID in VHT PPDU's. Pass this information to the driver
during add/set station operations (well, as soon as the information is
available, i.e., with set station operation currently).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agowpadebug: Add more common control interface commands to the list
Jouni Malinen [Sun, 5 May 2013 18:11:36 +0000 (21:11 +0300)]
wpadebug: Add more common control interface commands to the list

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpadebug: Add credential manager
Jouni Malinen [Sun, 5 May 2013 16:38:51 +0000 (19:38 +0300)]
wpadebug: Add credential manager

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpadebug: Add exception handling for missing resources
Jouni Malinen [Sun, 5 May 2013 15:28:25 +0000 (18:28 +0300)]
wpadebug: Add exception handling for missing resources

These errors should not really happen, but apparently they can if the
build dependencies get messed up somehow.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoHS 2.0: Include HS 2.0 Indication element only for HS 2.0 association
Jouni Malinen [Sun, 5 May 2013 13:29:21 +0000 (16:29 +0300)]
HS 2.0: Include HS 2.0 Indication element only for HS 2.0 association

The Hotspot 2.0 specification seems to mandate this element to be
included in all (Re)Association Request frames if the station is Hotspot
2.0 capable. However, that results in conflicts with other requirements
like no TKIP use when this element is present. The design is really
supposed to include the indication element only for Hotspot 2.0
associations regardless of what the current specification implies.
Remove the HS 2.0 Indication element from (Re)Association Request frame
whenever the connection is not for Hotspot 2.0 purposes.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoedit: Fix history processing on running old command
Jouni Malinen [Sun, 5 May 2013 10:09:55 +0000 (13:09 +0300)]
edit: Fix history processing on running old command

currbuf_valid needs to be cleared when an old command from history is
processed to avoid leaving a bogus entry that makes history_prev() skip
the last entry in history.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpa_cli: Fetch the current BSSID list when starting interactive mode
Jouni Malinen [Sun, 5 May 2013 09:38:55 +0000 (12:38 +0300)]
wpa_cli: Fetch the current BSSID list when starting interactive mode

This makes tab completion work better in cases where wpa_cli is started
after wpa_supplicant has already discovered BSSes.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpa_cli: Add BSSID tab completion for set bssid_filter
Jouni Malinen [Sun, 5 May 2013 09:20:35 +0000 (12:20 +0300)]
wpa_cli: Add BSSID tab completion for set bssid_filter

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpa_cli: Replace set command help with completion routine
Jouni Malinen [Sun, 5 May 2013 09:12:31 +0000 (12:12 +0300)]
wpa_cli: Replace set command help with completion routine

The old help text did not include most of the parameters and as such,
was not really helpful. Replace it with tab completion function that
includes more or less all available parameters.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpa_cli: Allow space in the set command value
Jouni Malinen [Sun, 5 May 2013 08:53:20 +0000 (11:53 +0300)]
wpa_cli: Allow space in the set command value

Previously, interactive mode could not be used to enter space-separated
lists with the set command. This removes that restriction and allows
such commands to be encoded properly.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpa_supplicant: Allow global scan frequencies configuration
Ben Greear [Sun, 5 May 2013 08:46:54 +0000 (11:46 +0300)]
wpa_supplicant: Allow global scan frequencies configuration

This allows one to limit the channels that wpa_supplicant will
scan. This is a useful addition to the freq_list configurable
in the network {} section.

Signed-hostap: Ben Greear <greearb@candelatech.com>

11 years agowpadebug: Add generic control interface command mechanism
Jouni Malinen [Sat, 4 May 2013 23:46:41 +0000 (02:46 +0300)]
wpadebug: Add generic control interface command mechanism

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpadebug: Add generic shell command mechanism
Jouni Malinen [Sat, 4 May 2013 22:46:07 +0000 (01:46 +0300)]
wpadebug: Add generic shell command mechanism

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpadebug: Report WSC NFC tag read to wpa_supplicant
Jouni Malinen [Sat, 4 May 2013 18:09:34 +0000 (21:09 +0300)]
wpadebug: Report WSC NFC tag read to wpa_supplicant

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpadebug: Move NFC intent activity into a separate class
Jouni Malinen [Sat, 4 May 2013 17:29:47 +0000 (20:29 +0300)]
wpadebug: Move NFC intent activity into a separate class

This simplifies both activities by making the DisplayMessageActity
simple text message displaying operation and the NFC activity as
something that is started only through NFC intent triggers.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoSynchronize build config comments for wpa_supplicant
Jouni Malinen [Sat, 4 May 2013 17:16:55 +0000 (20:16 +0300)]
Synchronize build config comments for wpa_supplicant

This updates number of comments in android.config to match the latest
version in defconfig and adds some of the entries that were previously
present only in android.config into defconfig.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoAndroid: Enable WPS ER and NFC support in the build
Jouni Malinen [Sat, 4 May 2013 17:12:44 +0000 (20:12 +0300)]
Android: Enable WPS ER and NFC support in the build

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Do not use void* in arithmetic
Jouni Malinen [Sat, 4 May 2013 17:11:16 +0000 (20:11 +0300)]
WPS: Do not use void* in arithmetic

This is a C compiler extension and not needed, so replace with standard
compliant way of calculating the pointer.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoRevert "nl80211: Add nla_put_u32() wrapper for Android"
Jouni Malinen [Sat, 4 May 2013 16:06:08 +0000 (19:06 +0300)]
Revert "nl80211: Add nla_put_u32() wrapper for Android"

This reverts commit df2f9ec6b2578def21fc26c88e661b5d28f0fbbf.

The current AOSP snapshot for JB includes nla_put_u32(), so this is not
needed anymore and is also causing linking issues due to duplicated
definition.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agowpadebug: Add WSC request through Android beam
Jouni Malinen [Sat, 4 May 2013 15:50:48 +0000 (18:50 +0300)]
wpadebug: Add WSC request through Android beam

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoHS 2.0: Move Probe Request Indication IE addition to proper place
Jouni Malinen [Sat, 4 May 2013 08:57:56 +0000 (11:57 +0300)]
HS 2.0: Move Probe Request Indication IE addition to proper place

This needs to be in wpa_supplicant_extra_ies() to get consistent
behavior for both scan and sched_scan cases.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPA: Print pairwise EAPOL-Key flag as a bool
Johannes Berg [Sat, 4 May 2013 08:48:57 +0000 (11:48 +0300)]
WPA: Print pairwise EAPOL-Key flag as a bool

Since "pairwise" is defined as an integer, the current assignment leads
to it having the value 0 or 8, which is a bit strange in debug output:

WPA: Send EAPOL(version=2 secure=1 mic=1 ack=1 install=1 pairwise=8
kde_len=46 keyidx=2 encr=1)

Use !!(...) to normalize it to 0 or 1.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

11 years agohostapd: Add Key MIC in group EAPOL-Key frames corruption test option
Johannes Berg [Sat, 4 May 2013 08:45:03 +0000 (11:45 +0300)]
hostapd: Add Key MIC in group EAPOL-Key frames corruption test option

For some testing it can be useful to force the Key MIC in group
EAPOL-Key frames to be corrupt. Add an option to allow setting a
probability for corrupting the Key MIC and use it in the WPA code,
increasing the first byte of the MIC by one to corrupt it if desired.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

11 years agowlantest: Fix the injection of protected broadcast frames
Chaitanya T K [Sat, 4 May 2013 08:36:28 +0000 (11:36 +0300)]
wlantest: Fix the injection of protected broadcast frames

Injecting protected broadcast frames fails because of the unnecessary
null check for sta. In case of broadcast frames sta can be null, so
remove the check.

Reported-by: Janardhan R <janardhanr@posedge.com>
Signed-hostap: Chaitanya T K <chaitanyatk@posedge.com>

11 years agonl80211: Fix max_remain_on_chan capability reading
Ilan Peer [Sat, 4 May 2013 08:28:54 +0000 (11:28 +0300)]
nl80211: Fix max_remain_on_chan capability reading

In case that NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP is supported,
wiphy_info_handler() is called several times, where
NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION is present only in one
of these calls. Thus capa->max_remain_on_chan is overridden in
all other calls.

Fix it so the default value is set only after all the wiphy info was
received.

Signed-hostap: Ilan Peer <ilan.peer@intel.com>

11 years agoP2P: Clone beacon_int when initializing new group interface
Ilan Peer [Sat, 4 May 2013 08:25:29 +0000 (11:25 +0300)]
P2P: Clone beacon_int when initializing new group interface

Signed-hostap: Ilan Peer <ilan.peer@intel.com>

11 years agowpadebug: Add a Wi-Fi debugging app for Android
Jouni Malinen [Thu, 2 May 2013 21:52:32 +0000 (00:52 +0300)]
wpadebug: Add a Wi-Fi debugging app for Android

This tool can be used to debug Wi-Fi functionality on Android both
through the Android framework and through direct access to
wpa_supplicant.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS: Remove duplicate networks after WPS
Vinayak Kamath [Tue, 30 Apr 2013 10:35:50 +0000 (13:35 +0300)]
WPS: Remove duplicate networks after WPS

Each attempt to connect to the same network using WPS would result
in the duplicate configuration getting added. Avoid such redundant
additions by comparing the network configuration with an already
existing one and remove the older network if the new credential
provisioned through WPS is identical.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agowpa_supplicant: Default to nl80211 instead of wext
Jouni Malinen [Mon, 29 Apr 2013 13:55:44 +0000 (16:55 +0300)]
wpa_supplicant: Default to nl80211 instead of wext

nl80211 has obsoleted WEXT as the preferred kernel interface for
controlling wireless drivers. Update wpa_supplicant driver interface
list order so that nl80211 gets used first if both nl80211 and wext
interfaces are included in the build. In addition, update README to
reflect the fact that WEXT is obsolete.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agohostapd: Add more messages for error paths
Jouni Malinen [Mon, 29 Apr 2013 10:52:34 +0000 (13:52 +0300)]
hostapd: Add more messages for error paths

Make hostapd more verbose if something goes wrong in interface
initialization.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agohostapd: Reject configuration file without interface parameter
Jouni Malinen [Mon, 29 Apr 2013 10:50:02 +0000 (13:50 +0300)]
hostapd: Reject configuration file without interface parameter

Previously, this was initialized partially, but the interface was
not really started. That could result in eloop_run() returning
immediately and hostapd process getting stopped without any clear
indication of a failure. [Bug 479]

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoClear extra_blacklist_count on FLUSH command
Jouni Malinen [Sun, 28 Apr 2013 19:35:15 +0000 (22:35 +0300)]
Clear extra_blacklist_count on FLUSH command

This is needed to avoid old blacklist failure counts from being valid
after state flush.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agotests: Test WPS ER UPnP functionality to add Enrollees
Jouni Malinen [Sun, 28 Apr 2013 19:00:58 +0000 (22:00 +0300)]
tests: Test WPS ER UPnP functionality to add Enrollees

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoWPS ER: Allow UPnP interface to be forced
Jouni Malinen [Sun, 28 Apr 2013 18:56:24 +0000 (21:56 +0300)]
WPS ER: Allow UPnP interface to be forced

"WPS_ER_START ifname=<interace>" can now be used to force a specific
interface to be used for UPnP operations. This is especially useful for
automated test cases where the lo interface can now be used easily to
perform ER operations.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoUse status code 17 (unable to handle new STA) on max-STA limitation
Ben Greear [Sun, 28 Apr 2013 13:45:55 +0000 (16:45 +0300)]
Use status code 17 (unable to handle new STA) on max-STA limitation

This is more useful information than the previously used value 1
(unspecified failure).

Signed-hostap: Ben Greear <greearb@candelatech.com>

11 years agoAdd dup_binstr() to help common binary string tasks
Jouni Malinen [Sat, 27 Apr 2013 20:44:59 +0000 (23:44 +0300)]
Add dup_binstr() to help common binary string tasks

There are quite a few places in the current implementation where a nul
terminated string is generated from binary data. Add a helper function
to simplify the code a bit.

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoUse os_zalloc() instead of os_malloc() + os_memset()
Jouni Malinen [Sat, 27 Apr 2013 20:05:52 +0000 (23:05 +0300)]
Use os_zalloc() instead of os_malloc() + os_memset()

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoFT RRB: Validate os_malloc() return value before using it
Jouni Malinen [Sat, 27 Apr 2013 20:05:15 +0000 (23:05 +0300)]
FT RRB: Validate os_malloc() return value before using it

Signed-hostap: Jouni Malinen <j@w1.fi>

11 years agoMake vlan_file optional if dynamic_vlan is used
Michael Braun [Sat, 27 Apr 2013 19:53:34 +0000 (22:53 +0300)]
Make vlan_file optional if dynamic_vlan is used

My APs generate their configuration on their own using a different
number of (vlan-enabled) bss. Currently, all my vlan_file files consist
of a single line: the wildcard line. Configuration file generation would
be easier, if the hostapd configuration file would not depend on those
simple vlan_file files.

This patch removes the need for those one-line files by using the
<device>.<vlan> naming scheme if no vlan_file is given (or that file is
empty). This should not break any existing setup, as using dynamic_vlan
with no vlan configured does not make sense anyway.

Signed-hostap: Michael Braun <michael-dev@fami-braun.de>

11 years agoAdd bitfield routines
Jouni Malinen [Sat, 16 Mar 2013 16:12:39 +0000 (18:12 +0200)]
Add bitfield routines

Signed-hostap: Jouni Malinen <j@w1.fi>