9 years agoDescribe requirements for contributions to hostap.git
Jouni Malinen [Sat, 29 Oct 2011 10:43:43 +0000 (13:43 +0300)]
Describe requirements for contributions to hostap.git

This provides explicit description of requirements for contributions
that have been assumed and less formally confirmed in the past.

9 years agoRemove www directory ( web pages)
Jouni Malinen [Sat, 29 Oct 2011 09:24:03 +0000 (12:24 +0300)]
Remove www directory ( web pages)

These are now maintained in a separate repository (hostap-www.git)
and do not need to remain in hostap.git.

9 years agoRemove unused valid_bss_mask driver_ops
Jouni Malinen [Sat, 29 Oct 2011 08:34:29 +0000 (11:34 +0300)]
Remove unused valid_bss_mask driver_ops

9 years agoRemove unconfigurable cts_protection_type
Jouni Malinen [Sat, 29 Oct 2011 08:24:53 +0000 (11:24 +0300)]
Remove unconfigurable cts_protection_type

This was included in the AP configuration parameters, but there has
been no way to set it to anything else than the default automatic
mode. Remove this parameter and just hardcode ERP determination to
follow the automatic mode.

9 years agoFor MS-CHAP, convert the password from UTF-8 to UCS-2
Evan Broder [Fri, 28 Oct 2011 21:23:54 +0000 (00:23 +0300)]
For MS-CHAP, convert the password from UTF-8 to UCS-2

The MS-CHAPv1 and MS-CHAPv2 RFCs specify that the password is a string
of "Unicode characters", which for Windows means UCS-2; thus the
password could be any even-length string of up to 512 bytes.

Instead of making the incompatible change of requiring the incoming
password to be UCS-2 encoded, assume the password is UTF-8 encoded and
convert it before using it in NtPasswordHash and

Signed-off-by: Evan Broder <>
9 years agowpa_cli: Argument completion for p2p_group_remove
Jouni Malinen [Fri, 28 Oct 2011 20:59:13 +0000 (23:59 +0300)]
wpa_cli: Argument completion for p2p_group_remove

Track active P2P groups and complete p2p_group_remove argument.

9 years agowpa_cli: Add completion functions for P2P peers and BSSes
Jouni Malinen [Fri, 28 Oct 2011 20:37:34 +0000 (23:37 +0300)]
wpa_cli: Add completion functions for P2P peers and BSSes

Keep a local list of found P2P peers and BSS entries and use those
to complete arguments for p2p_peer, p2p_connect, and bss commands.

9 years agodl_list: Add DEFINE_DL_LIST
Johannes Berg [Fri, 28 Oct 2011 20:03:13 +0000 (23:03 +0300)]
dl_list: Add DEFINE_DL_LIST

This allows statically defining an empty initialised list.

9 years agoP2P: Fix frequency in the P2P_EVENT_GROUP_STARTED event
Jithu Jance [Fri, 28 Oct 2011 19:26:30 +0000 (22:26 +0300)]
P2P: Fix frequency in the P2P_EVENT_GROUP_STARTED event

P2P Client did not show correct frequency in the control interface
event P2P_EVENT_GROUP_STARTED. Fix that by using the frequency from
the BSS table or association event.

9 years agoP2P: Notify device expiry via P2P-DEVICE-LOST event
Jithu Jance [Fri, 28 Oct 2011 19:13:18 +0000 (22:13 +0300)]
P2P: Notify device expiry via P2P-DEVICE-LOST event

This patch will notify applications listening over control socket about
the device expiry [from p2p peer list].

9 years agoAutomatically include WPS and AP support if P2P is enabled
Jouni Malinen [Fri, 28 Oct 2011 18:17:08 +0000 (21:17 +0300)]
Automatically include WPS and AP support if P2P is enabled

CONFIG_WPS=y and CONFIG_AP=y are required if CONFIG_P2P=y so
we may as well enable them automatically in that case.

9 years agonl80211: Ignore netlink interface down if interface is up
Jouni Malinen [Fri, 28 Oct 2011 18:08:15 +0000 (21:08 +0300)]
nl80211: Ignore netlink interface down if interface is up

The netlink event processing is delayed since they are only returned
after control returns to eloop. This can result in netlink down events
being processed at a point when the interface has is actually still
there (the first event on new interface is down) and that can result in
odd behavior especially when the resulting interface-disabled event is
delivered to AP mode interface with wpa_supplicant.

Work around this by filtering netlink down events if the matching
interface is up at the time the netlink event is processed. This fixes
an issue brought up by commit 36d84860bbe09641f782fcc21b09e5a6952b4629.

9 years agoFix WPA authenticator configuration to not leave uninitialized fields
Jouni Malinen [Fri, 28 Oct 2011 09:03:45 +0000 (12:03 +0300)]
Fix WPA authenticator configuration to not leave uninitialized fields

hostapd_wpa_auth_conf() is called on uninitialized memory and the
conditional blocks in this function may leave some fields into
uninitialized state. This can result in unexpected behavior elsewhere
since some of the variables may be used without matching #ifdef
blocks. Fix this by zeroing the memory.

9 years agoTDLS: Do not clear peer data too early for teardown
Jouni Malinen [Thu, 27 Oct 2011 20:15:46 +0000 (23:15 +0300)]
TDLS: Do not clear peer data too early for teardown

TPK will be needed to be able to generate FTIE MIC for the
teardown message, so maintain peer data for a bit longer in
case the teardown FTIE request comes back from the driver.

9 years agoTDLS: Disable link on various error cases
Jouni Malinen [Thu, 27 Oct 2011 20:13:54 +0000 (23:13 +0300)]
TDLS: Disable link on various error cases

This is needed to be able to return back to AP path on error cases.

9 years agoTDLS: Disable previous link to fix renegotiation
Jouni Malinen [Thu, 27 Oct 2011 20:13:14 +0000 (23:13 +0300)]
TDLS: Disable previous link to fix renegotiation

9 years agoTDLS: Fix concurrent initialization test code
Jouni Malinen [Thu, 27 Oct 2011 20:12:08 +0000 (23:12 +0300)]
TDLS: Fix concurrent initialization test code

Must not use data from peer TDLS Setup Request if the concurrent
initialization from us is supposed to be the one that gets completed.

9 years agoTDLS: Fix teardown on renegotiation
Jouni Malinen [Thu, 27 Oct 2011 20:10:21 +0000 (23:10 +0300)]
TDLS: Fix teardown on renegotiation

Need to disable the link when receiving TDLS Setup Request from a
peer with which a direct link has already been set up.

9 years agoTDLS: Fix long frame test for teardown
Jouni Malinen [Thu, 27 Oct 2011 20:09:23 +0000 (23:09 +0300)]
TDLS: Fix long frame test for teardown

9 years agoP2P: Stop any on-going "p2p_find" on creating an Autonomous GO
Jithu Jance [Tue, 25 Oct 2011 22:28:51 +0000 (01:28 +0300)]
P2P: Stop any on-going "p2p_find" on creating an Autonomous GO

This patch stops any on-going "p2p_find" on creating an Autonomous GO.
This is already taken care in case of invoking a persistent GO. GO as
such will be advertising via the beacons for other devices to discover.
So normally the GO doesn't need to do a p2p_find until and unless it
wants to invite a P2P Client. In case of Invite scenario, logically it
is better to do a explicit discover [via user intervention] after the GO
is created. This patch will help to reduce battery wastage [due to
p2p_find operations] in scenarios where user creates a GO and doesn't
initiate a connection.

9 years agowlantest: Add STA counters for disconnect reason 6/7 RX
Jouni Malinen [Tue, 25 Oct 2011 21:06:06 +0000 (00:06 +0300)]
wlantest: Add STA counters for disconnect reason 6/7 RX

These can be useful in tests involving association state mismatch
between the AP and the STA (i.e., STA assumes it is still associated
but the AP does not have association state). In such a case, the AP
would be sending out unprotected Deauthentication or Disassociation
frames with reason code 6 or 7 depending on what frame is triggering

9 years agoInterworking: Fix Advertisement Protocol element length limit
Jay Katabathuni [Tue, 25 Oct 2011 08:31:21 +0000 (11:31 +0300)]
Interworking: Fix Advertisement Protocol element length limit

The Query Response Length Limit is not allowed to be zero when
this is sent by the AP. Use 0x7F to indicate that the limit is
based on maximum number of GAS fragments.

9 years agoP2P: Append P2P Device Address to AP-STA-CONNECTED event
Jithu Jance [Mon, 24 Oct 2011 21:13:03 +0000 (00:13 +0300)]
P2P: Append P2P Device Address to AP-STA-CONNECTED event

For P2P, the p2p_connect takes in device address argument to make a
connection. However the connected event AP-STA-CONNECTED comes with
interface address. The application listening on events would find it
difficult to map interface address to the p2p device address which is
provided for connection.

Append P2P Device Address to AP-STA-CONNECTED event for P2P Client
connection. This will help applications to easily map the P2P Interface
Address to P2P Device Address on CONNECTED event. For non-P2P case, it
will just print the usual STA MAC address alone.

Signed-off-by: Jithu Jance <>
9 years agoP2P: Fix wpa_supplicant crash on P2P WPS PBC overlap case
Jithu Jance [Mon, 24 Oct 2011 20:37:39 +0000 (23:37 +0300)]
P2P: Fix wpa_supplicant crash on P2P WPS PBC overlap case

Once PBC overlap detected when using dynamic group interfaces, the wpa_s
corresponding to P2P group interface is freed. This patch avoids
accessing the wpa_s data structure after it is freed. This fixes a
possible crash in P2P client role in such a case.

9 years agoP2P: Advertise Persistent Reconnect group capability
Jouni Malinen [Mon, 24 Oct 2011 14:29:37 +0000 (17:29 +0300)]
P2P: Advertise Persistent Reconnect group capability

The persistent_reconnect configuration parameter was used to decide
whether to accept invitation to re-establish a persistent group.
However, this was not being advertised in the Group Capability bitmap.
Add the Persistent Reconnect bit based on this configuration to GO
Negotiation frames and Beacon/Probe Response frames from the GO.

9 years agoTDLS: Make use of wpa_tdls_add_peer to avoid code duplication
Arik Nemtsov [Mon, 26 Sep 2011 10:55:34 +0000 (13:55 +0300)]
TDLS: Make use of wpa_tdls_add_peer to avoid code duplication

Use the wpa_tdls_add_peer function to allocate TDLS peer structures.

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agoTDLS: Support mgmt-frame Tx for ctrl-iface operations
Arik Nemtsov [Mon, 26 Sep 2011 10:55:33 +0000 (13:55 +0300)]
TDLS: Support mgmt-frame Tx for ctrl-iface operations

Use capability information to decide whether to perform a given TDLS
operation internally or through mgmt-frame Tx.

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agoTDLS: Add peer as a STA during link setup
Arik Nemtsov [Sun, 23 Oct 2011 11:02:57 +0000 (14:02 +0300)]
TDLS: Add peer as a STA during link setup

Before commencing setup, add a new STA entry to the driver representing
the peer. Later during setup, update the STA entry using information
received from the peer.

Extend sta_add() callback for adding/modifying a TDLS peer entry and
connect it to the TDLS state machine. Implement this callback for the
nl80211 driver and send peer information to kernel.

Mark TDLS peer entries with a new flag and translate it to a
corresponding nl80211 flag in the nl80211 driver.

In addition, correct TDLS related documentation in the wpa_driver_ops

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agoTDLS: Collect peer capabilities and supp-rates during link setup
Arik Nemtsov [Mon, 26 Sep 2011 10:55:31 +0000 (13:55 +0300)]
TDLS: Collect peer capabilities and supp-rates during link setup

Record the capabilities and supported rates of the TDLS peer during
link setup. These are given in the IEs passed in Setup Request and
Setup Response frames.

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agoTDLS: Implement low-ack event for lost TDLS peers
Arik Nemtsov [Mon, 26 Sep 2011 10:55:30 +0000 (13:55 +0300)]
TDLS: Implement low-ack event for lost TDLS peers

Disable the direct connection when a TDLS peer stops responding
to packets, as indicated by the "LOW ACK" event coming from a driver.

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agoTDLS: Support sending TDLS discovery requests
Arik Nemtsov [Mon, 26 Sep 2011 10:55:29 +0000 (13:55 +0300)]
TDLS: Support sending TDLS discovery requests

Allow sending a TDLS discovery request as a frame through the driver.

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agoTDLS: Support sending a teardown frame from usermode
Arik Nemtsov [Mon, 26 Sep 2011 10:55:28 +0000 (13:55 +0300)]
TDLS: Support sending a teardown frame from usermode

When a driver does not implement the TDLS_TEARDOWN operation internally,
send an explicit TDLS link teardown frame to the driver.

Change all teardown calls to use these calling semantics.

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agoTDLS/nl80211: Support receiving TDLS discovery response frames
Arik Nemtsov [Mon, 26 Sep 2011 10:55:27 +0000 (13:55 +0300)]
TDLS/nl80211: Support receiving TDLS discovery response frames

Register for the TDLS discovery response public action frame in nl80211.
Print out a debug message when a Discovery Resp frame is received and

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agoTDLS: Process discovery requests and send discovery responses
Arik Nemtsov [Mon, 26 Sep 2011 10:55:26 +0000 (13:55 +0300)]
TDLS: Process discovery requests and send discovery responses

When a discovery request is received, add the peer to the TDLS peer
cache and send a response containing minimal data. Mandatory IEs in
the discovery response frame will be filled out by the driver.

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agoTDLS: Get TDLS related capabilities from driver
Arik Nemtsov [Mon, 26 Sep 2011 10:55:25 +0000 (13:55 +0300)]
TDLS: Get TDLS related capabilities from driver

Put glue code in place to propagate TDLS related driver capabilities to
the TDLS state machine.

If the driver doesn't support capabilities, assume TDLS is supported

When TDLS is explicitly not supported, disable all user facing TDLS

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agonl80211: Implement TDLS callback functions and propagate capabilities
Arik Nemtsov [Sun, 23 Oct 2011 10:59:00 +0000 (13:59 +0300)]
nl80211: Implement TDLS callback functions and propagate capabilities

Allow passing high-level TDLS commands and TDLS frames to kernel
via new nl80211 commands.

Propagate TDLS related nl80211 capability flags from kernel and add them
as driver capability flags.

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agoTDLS: Use a valid dialog-token in a setup request
Arik Nemtsov [Mon, 26 Sep 2011 10:55:35 +0000 (13:55 +0300)]
TDLS: Use a valid dialog-token in a setup request

A zero dialog-token is considered invalid by IEEE Std 802.11z-2010.

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agoTDLS: Support setting CONFIG_TDLS_TESTING in .config
Arik Nemtsov [Mon, 26 Sep 2011 10:55:22 +0000 (13:55 +0300)]
TDLS: Support setting CONFIG_TDLS_TESTING in .config

Signed-off-by: Arik Nemtsov <>
Cc: Kalyan C Gaddam <>
9 years agonl80211: Handle special TDLS direct link key index use
Jouni Malinen [Sun, 23 Oct 2011 19:12:32 +0000 (22:12 +0300)]
nl80211: Handle special TDLS direct link key index use

An ugly hack is currently used to indicate keys for TDLS direct link:
key_idx == -1. That needs to be converted to 0 for cfg80211 to accept
the key.

9 years agohwsim_test: Fix silly bug in select() result processing
Jouni Malinen [Sun, 23 Oct 2011 19:11:48 +0000 (22:11 +0300)]
hwsim_test: Fix silly bug in select() result processing

9 years agoRemove incorrect statement about get_hw_feature_data() driver_ops
Jouni Malinen [Sun, 23 Oct 2011 17:09:40 +0000 (20:09 +0300)]
Remove incorrect statement about get_hw_feature_data() driver_ops

This function is actually needed for quite a bit more than just
user space MLME implementation. The old comment here has not been
accurate for a long time, so get rid of it.

9 years agoRemove unused driver_ops client MLME functions
Jouni Malinen [Sun, 23 Oct 2011 17:07:57 +0000 (20:07 +0300)]
Remove unused driver_ops client MLME functions

These driver_ops functions set_channel, set_ssid, set_bssid,
mlme_add_sta, and mlme_remove_sta were used with the user space
MLME implementation in wpa_supplicant. That was only for testing
purposes and was removed, but these driver_ops were forgotten.
Remove them now to remove confusing driver_ops definitions.

9 years agowpa_supplicant: Check rate sets before joining BSS
Christian Lamparter [Sun, 23 Oct 2011 08:58:54 +0000 (11:58 +0300)]
wpa_supplicant: Check rate sets before joining BSS

IEEE Std 802.11-2007 demands that in order to join a BSS all
required basic rates have to be supported by the hardware.

Signed-off-by: Christian Lamparter <>
9 years agowpa_supplicant: Unify hardware feature data
Christian Lamparter [Sun, 23 Oct 2011 08:58:54 +0000 (11:58 +0300)]
wpa_supplicant: Unify hardware feature data

The hardware feature data is required in several different places
throughout the code. Previously, the data was acquired and freed on
demand, but with this patch wpa_supplicant will keep a single copy
around at runtime for everyone to use.

Signed-off-by: Christian Lamparter <>
9 years agoAllow driver wrappers to indicate whether HT info is known
Jouni Malinen [Sun, 23 Oct 2011 14:17:39 +0000 (17:17 +0300)]
Allow driver wrappers to indicate whether HT info is known

This is needed to be able to figure out whether the driver is known
not to support HT.

9 years agoPostpone global_init() call until first driver instance is initialized
Jouni Malinen [Sun, 23 Oct 2011 10:20:52 +0000 (13:20 +0300)]
Postpone global_init() call until first driver instance is initialized

This avoids allocating global driver state for driver wrappers that
are built in but not used. This can save some resources and avoids
failures with driver_nl80211.c that is now initializing netlink
connections for nl80211 in global_init().

9 years agoTLS: Validate RSA ClientKeyExchange length field
Jouni Malinen [Sun, 23 Oct 2011 10:04:32 +0000 (13:04 +0300)]
TLS: Validate RSA ClientKeyExchange length field

Instead of using implicit length based on the received buffer, validate
RSA ClientKeyExchange based on the explicit length field.

9 years agoRemove unused variables
Jouni Malinen [Sun, 23 Oct 2011 09:42:55 +0000 (12:42 +0300)]
Remove unused variables

9 years agodbus: Removed unused local variable
Grant Erickson [Sun, 23 Oct 2011 09:36:04 +0000 (12:36 +0300)]
dbus: Removed unused local variable

Signed-off-by: Grant Erickson <>
9 years agoFix hostapd_wpa_auth_send_ether() return value
Jouni Malinen [Sun, 23 Oct 2011 09:33:17 +0000 (12:33 +0300)]
Fix hostapd_wpa_auth_send_ether() return value

This was not currently used for anything, but better return the correct
value instead of hardcoded -1.

9 years agoComment out scard initialization code if PCSC_FUNCS is not set
Jouni Malinen [Sun, 23 Oct 2011 09:24:36 +0000 (12:24 +0300)]
Comment out scard initialization code if PCSC_FUNCS is not set

9 years agoRemove unused variable from os_gmtime()
Jouni Malinen [Sun, 23 Oct 2011 09:22:40 +0000 (12:22 +0300)]
Remove unused variable from os_gmtime()

9 years agonl80211: Remove some unnecessary ifdef HOSTAPD blocks
Jouni Malinen [Sat, 22 Oct 2011 19:51:49 +0000 (22:51 +0300)]
nl80211: Remove some unnecessary ifdef HOSTAPD blocks

9 years agoRemove user space client MLME
Jouni Malinen [Sat, 22 Oct 2011 19:45:38 +0000 (22:45 +0300)]
Remove user space client MLME

This code was used only with driver_test.c to allow MLME operations
in hostapd to be tested without having to use a real radio. There
are no plans on extending this to any other use than testing and
mac80211_hwsim has now obsoled the need for this type of testing.
As such, we can drop this code from wpa_supplicant to clean up the
implementation of unnecessary complexity.

9 years agoAdd CONFIG_WPS_REG_DISABLE_OPEN to defconfig
Andrii Bordunov [Sat, 22 Oct 2011 19:24:34 +0000 (22:24 +0300)]

9 years agoWPS: Use ifdef blocks consistently for CONFIG_WPS_REG_DISABLE_OPEN
Andrii Bordunov [Sat, 22 Oct 2011 19:21:53 +0000 (22:21 +0300)]
WPS: Use ifdef blocks consistently for CONFIG_WPS_REG_DISABLE_OPEN

The registrar variable is used only if this macro is defined, so no
need to set it otherwise.

9 years agowpa_priv: Link in trace.o to fix CONFIG_WPA_TRACE build
Andrii Bordunov [Sat, 22 Oct 2011 19:18:54 +0000 (22:18 +0300)]
wpa_priv: Link in trace.o to fix CONFIG_WPA_TRACE build

9 years agowpa_priv: Link in ieee802_11_common.o if driver_nl80211 is used
Jouni Malinen [Sat, 22 Oct 2011 19:16:11 +0000 (22:16 +0300)]
wpa_priv: Link in ieee802_11_common.o if driver_nl80211 is used

9 years agowpa_priv: Update function arguments to fix compilation
Andrii Bordunov [Sat, 22 Oct 2011 19:11:40 +0000 (22:11 +0300)]
wpa_priv: Update function arguments to fix compilation

9 years agoShare a single wpa_scan_results_free() implementation
Jouni Malinen [Sat, 22 Oct 2011 19:09:40 +0000 (22:09 +0300)]
Share a single wpa_scan_results_free() implementation

There is not really a very good location for this anywhere, but the
function is small enough to live as an inline function for now.

9 years agoRemove unused variable and function
Andrii Bordunov [Sat, 22 Oct 2011 18:59:17 +0000 (21:59 +0300)]
Remove unused variable and function

9 years agoFix typo in comment related to EAPOL
Ben Greear [Sat, 22 Oct 2011 18:41:09 +0000 (21:41 +0300)]
Fix typo in comment related to EAPOL

Signed-off-by: Ben Greear <>
9 years agonl80211: Use one global ioctl socket
Ben Greear [Sat, 22 Oct 2011 18:33:58 +0000 (21:33 +0300)]
nl80211: Use one global ioctl socket

Saves sockets when using multiple VIFS in a single
wpa_supplicant process.

Signed-off-by: Ben Greear <>
9 years agonl80211: Use a global netlink command object
Ben Greear [Sat, 22 Oct 2011 16:00:27 +0000 (19:00 +0300)]
nl80211: Use a global netlink command object

Netlink sockets can be shared among all driver instances, saving
sockets and memory when using multiple interfaces in a single process.

9 years agonl80211: Use global nl_cb template
Ben Greear [Sat, 22 Oct 2011 15:42:42 +0000 (18:42 +0300)]
nl80211: Use global nl_cb template

All interfaces can share a single nl_cb template.

9 years agonl80211: Clean up error path in wpa_driver_nl80211_init
Ben Greear [Sat, 22 Oct 2011 15:28:06 +0000 (18:28 +0300)]
nl80211: Clean up error path in wpa_driver_nl80211_init

No need to duplicate the deinit code since wpa_driver_nl80211_deinit()
can be used here to clean up after a failure.

9 years agonl80211: Abstract handle/cache (de)allocation
Johannes Berg [Sat, 22 Oct 2011 13:56:43 +0000 (16:56 +0300)]
nl80211: Abstract handle/cache (de)allocation

This is a cleanup now and makes it easier to add more sockets in the

9 years agonl80211: Fix hostapd error path
Johannes Berg [Sat, 22 Oct 2011 10:04:47 +0000 (13:04 +0300)]
nl80211: Fix hostapd error path

i802_init() tries to clean up everything manually, call
wpa_driver_nl80211_deinit() instead and also handle the
EAPOL socket properly.

9 years agonl80211: Use global netlink rtm event object
Ben Greear [Thu, 20 Oct 2011 23:03:25 +0000 (02:03 +0300)]
nl80211: Use global netlink rtm event object

Netlink sockets can be shared among all driver instances, saving lots
of sockets, spurious log messages, memory, and CPU usage when using
multiple interfaces in a single process.

9 years agohostapd: Call global_init/global_deinit driver_ops
Jouni Malinen [Sat, 22 Oct 2011 08:59:00 +0000 (11:59 +0300)]
hostapd: Call global_init/global_deinit driver_ops

Now both wpa_supplicant and hostapd allow the driver wrappers to use the
global context similarly.

9 years agonl80211: Use a wrapper for genlmsg_put
Jouni Malinen [Thu, 20 Oct 2011 22:34:54 +0000 (01:34 +0300)]
nl80211: Use a wrapper for genlmsg_put

This reduces the code size by a kilobyte or so and makes it easier
to replace the netlink instances to be shared among interfaces.

9 years agowext: Do not set SSID on disconnect on Android
Dmitry Shmidt [Fri, 21 Oct 2011 16:11:07 +0000 (19:11 +0300)]
wext: Do not set SSID on disconnect on Android

Some drivers seem to try to associate using the random SSID, so
do not use this hack on Android.

9 years agowext: Clean up the disconnect BSSID/SSID clearing
Jouni Malinen [Fri, 21 Oct 2011 16:09:25 +0000 (19:09 +0300)]
wext: Clean up the disconnect BSSID/SSID clearing

9 years agoPrevent ap_scan change during association
Dmitry Shmidt [Tue, 16 Aug 2011 18:52:06 +0000 (11:52 -0700)]
Prevent ap_scan change during association

Signed-off-by: Dmitry Shmidt <>
9 years agoSet ANDROID_LOG_NAME depending on application
Dmitry Shmidt [Fri, 21 Oct 2011 14:26:35 +0000 (17:26 +0300)]
Set ANDROID_LOG_NAME depending on application

Signed-off-by: Dmitry Shmidt <>
9 years agoAdd blacklist command
Dmitry Shmidt [Tue, 18 Oct 2011 17:11:52 +0000 (20:11 +0300)]
Add blacklist command

This command allows an external program manage the BSS blacklist
and display its current contents.

Note: The blacklist is considered to be internal mechanism within
wpa_supplicant and changing it can have unexpected results.

Signed-off-by: Dmitry Shmidt <>
9 years agowext: Remove trailing whitespace
Jouni Malinen [Fri, 21 Oct 2011 15:58:01 +0000 (18:58 +0300)]
wext: Remove trailing whitespace

9 years agoInterworking: Allow ANT to be configured for Probe Request frames
Jouni Malinen [Fri, 21 Oct 2011 09:44:29 +0000 (12:44 +0300)]
Interworking: Allow ANT to be configured for Probe Request frames

Access Network Type can now be configured (default: 15 = wildcard) to
limit which APs reply to the scan.

9 years agoInterworking: Filter Probe Request frames based on HESSID and ANT
Jouni Malinen [Fri, 21 Oct 2011 09:43:53 +0000 (12:43 +0300)]
Interworking: Filter Probe Request frames based on HESSID and ANT

Do not reply to Interworking-enabled Probe Request frames if they
request mismatching HESSID or ANT.

9 years agoInterworking: Add Interworking element to IE parser
Jouni Malinen [Fri, 21 Oct 2011 09:43:24 +0000 (12:43 +0300)]
Interworking: Add Interworking element to IE parser

9 years agoInterworking: Include Access Network Type in set_ap() driver_ops
Jouni Malinen [Fri, 21 Oct 2011 09:12:36 +0000 (12:12 +0300)]
Interworking: Include Access Network Type in set_ap() driver_ops

This may be needed for drivers that process Probe Request frames

9 years agonl80211: Clean up capability querying
Johannes Berg [Thu, 20 Oct 2011 18:57:32 +0000 (21:57 +0300)]
nl80211: Clean up capability querying

There's no need to store everything once and then copy it. Just fill the
capa struct directly in the function that parses the info from nl80211.

9 years agoAP: Pass only bssid/addr/wds to EVENT_RX_FROM_UNKNOWN
Johannes Berg [Thu, 20 Oct 2011 18:51:32 +0000 (21:51 +0300)]
AP: Pass only bssid/addr/wds to EVENT_RX_FROM_UNKNOWN

9 years agoMove get_hdr_bssid() to make it easier to share for other uses
Johannes Berg [Thu, 20 Oct 2011 18:50:23 +0000 (21:50 +0300)]
Move get_hdr_bssid() to make it easier to share for other uses

9 years agonl80211: Stop more quickly on initialization errors
Jouni Malinen [Thu, 20 Oct 2011 18:36:36 +0000 (21:36 +0300)]
nl80211: Stop more quickly on initialization errors

Stop on fatal errors like an attempt to use a non-existing interface or
not have root privileges to avoid producing confusing error messages.

9 years agoFix segfault on error path if driver initialization fails
Jouni Malinen [Thu, 20 Oct 2011 18:10:22 +0000 (21:10 +0300)]
Fix segfault on error path if driver initialization fails

wpa_s->wpa is NULL in this case and we better not call WPA state
machine functions.

9 years agonl80211: Compat code for genl_ctrl_alloc_cache
Johannes Berg [Thu, 20 Oct 2011 18:08:26 +0000 (21:08 +0300)]
nl80211: Compat code for genl_ctrl_alloc_cache

It's really a waste of bits to duplicate the code for
genl_ctrl_alloc_cache() again and again -- just add a
wrapper like in iw.

9 years agoAP: Do station poll in driver wrapper
Johannes Berg [Thu, 20 Oct 2011 18:03:08 +0000 (21:03 +0300)]
AP: Do station poll in driver wrapper

This offloads the station polling to driver wrappers, which may offload
it again to the driver. The hostap driver wrapper uses "real" data
frames while nl80211 uses null data frames.

Also add a specific event to indicate that a poll was successful for
future use with the nl80211 driver.

9 years agoInterworking: Use unsigned integer for bitfield
Jouni Malinen [Thu, 20 Oct 2011 17:49:21 +0000 (20:49 +0300)]
Interworking: Use unsigned integer for bitfield

Signed integer with one-bit value does not make much sense, so clean
this up by using an unsigned integer instead.

9 years agowext: Increase scan timeout from 5 to 10 seconds
Jouni Malinen [Tue, 18 Oct 2011 20:04:36 +0000 (23:04 +0300)]
wext: Increase scan timeout from 5 to 10 seconds

Some dualband cards can use more than five seconds to run through
a full scan, so increase the timeout to avoid hitting the missing
scan completed event workaround.

9 years agoAdd log_level command
Dmitry Shmidt [Tue, 18 Oct 2011 17:16:38 +0000 (20:16 +0300)]
Add log_level command

This can be used to display the current debugging level and to change
the log level during run time.

Signed-off-by: Dmitry Shmidt <>
9 years agoEAP: Clear ClientTimeout back to default value in INITIALIZE
Jouni Malinen [Tue, 18 Oct 2011 15:44:35 +0000 (18:44 +0300)]
EAP: Clear ClientTimeout back to default value in INITIALIZE

This fixes an issue where WPS run leaves a small ClientTimeout
value (2) configured and the next EAPOL authentication is started
with that small value even for Identity exchange. This can cause
problems when an EAPOL packet gets dropped immediately after
association and a retry of that packet is needed (which may take
more than two seconds).

9 years agoAndroid: Add wpa_ctrl_cleanup()
Dmitry Shmidt [Tue, 18 Oct 2011 14:27:53 +0000 (17:27 +0300)]
Android: Add wpa_ctrl_cleanup()

This function can be used to clean up local UNIX domain socket files
that may be left over from clients that were previously connected to
wpa_supplicant. At least for now, this is only available for Android

9 years agoAndroid: Sync with recent Makefile changes
Jouni Malinen [Tue, 18 Oct 2011 14:15:36 +0000 (17:15 +0300)]
Android: Sync with recent Makefile changes

9 years agonetlink: Do not use void pointer for pointer arithmetic
Jouni Malinen [Tue, 18 Oct 2011 14:00:08 +0000 (17:00 +0300)]
netlink: Do not use void pointer for pointer arithmetic

This is a non-standard extension in gcc, so better not depend on it.

9 years agoAdd support for Time Advertisement
Jouni Malinen [Mon, 17 Oct 2011 21:24:16 +0000 (00:24 +0300)]
Add support for Time Advertisement

This adds preliminary support for IEEE 802.11v Time Advertisement
mechanism with UTC TSF offset.

9 years agoAdd os_gmtime() as wrapper for gmtime()
Jouni Malinen [Mon, 17 Oct 2011 21:23:42 +0000 (00:23 +0300)]
Add os_gmtime() as wrapper for gmtime()

9 years agoInterworking: Add support for configuring Roaming Consortium List
Jouni Malinen [Mon, 17 Oct 2011 20:55:50 +0000 (23:55 +0300)]
Interworking: Add support for configuring Roaming Consortium List

9 years agoInterworking: Add Advertisement Protocol element
Jouni Malinen [Mon, 17 Oct 2011 20:19:52 +0000 (23:19 +0300)]
Interworking: Add Advertisement Protocol element

For now, assume that ANQP will always be enabled with Interworking.
This may be made separately configurable in the future.

9 years agoRemove set_intra_bss() driver_ops
Jouni Malinen [Mon, 17 Oct 2011 20:04:27 +0000 (23:04 +0300)]
Remove set_intra_bss() driver_ops

This has been replaced by the isolate parameter available through
set_ap() calls.