Commit graph

197 commits

Author SHA1 Message Date
Jouni Malinen
7b7ce8aa13 Deauthenticate on reconfiguration
This makes sure that the old connection is not maintained if the new
configuration does not allow it anymore. In addition, it is better to
use wpa_supplicant_clear_connection() instead of just clearing
wpa_s->current_ssid here to keep things in sync.
2011-07-16 16:57:11 +03:00
Jouni Malinen
7dcdcfd68d P2P: Start GO without extra scan step
There are some corner cases, where the wpa_supplicant_req_scan() call
may end up scheduling a scan even if we are about to start a GO. Avoid
this by explicitly marking the GO network to be selected for the next
connection.
2011-06-21 11:47:03 +03:00
Jouni Malinen
38e24575c1 random: Add support for maintaining internal entropy store over restarts
This can be used to avoid rejection of first two 4-way handshakes every
time hostapd (or wpa_supplicant in AP/IBSS mode) is restarted. A new
command line parameter, -e, can now be used to specify an entropy file
that will be used to maintain the needed state.
2011-05-31 20:07:11 +03:00
Jouni Malinen
849b5dc78b Update driver country info on 'SET country <value>' 2011-04-15 17:00:01 +03:00
Jouni Malinen
95cb2d88e9 TDLS: Verify that scan results for BSS are available before using them 2011-04-14 19:50:26 +03:00
Dmitry Shmidt
67b9bd089b Make scan interval configurable
It is now possible to configure the the time in seconds that
wpa_supplicant waits before requesting a new scan after failing to find
a suitable network in scan results.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-04-11 23:14:38 +03:00
Paul Stewart
14dc00115e dbus: Add "excessive" to debug_strings
The "debug_strings" private array in dbus_new_handles.c has fallen out
of sync with wpa_debug.h. Add the new "excessive" level to the head of
the list, realigning everything.

Signed-off-by: Paul Stewart <pstew@google.com>
2011-03-31 17:38:08 +03:00
Jouni Malinen
78177a000e RSN IBSS: Restart IBSS state machines for each new IBSS
Change the old design of running a single long living RSN IBSS
instance to keep a separate instance for each IBSS connection.
This fixes number of issues in getting keys set properly for
new connections and is in general quite a bit more correct
design.
2011-03-23 21:15:46 +02:00
Jouni Malinen
d47fa330b8 random: Read /dev/random in the background with eloop read socket
This makes it more likely to be able to fetch the 20 octet seed from
/dev/random in cases where other programs may also be competing for
this.
2011-03-22 23:15:00 +02:00
Sam Leffler
78633c3709 wpa_supplicant: Parameterize BSS table expiration age + count
Replace compile-time BSS cache expiration age and scan count by config
parameters that can be set via wpa_cli and the new D-Bus API. The latter
is done with interface properties BSSExpireAge and BSSExpireCount.
2011-03-20 12:40:59 +02:00
Paul Stewart
cfe53c9aa5 wpa_supplicant: Start bgscan on COMPLETED, not ASSOCIATED
Move the code snippet to switch on bgscan over to wpa_supplicant.c
from event.c, so that it can be activated on wpa_supplicant_set_state().
Also create a centralized place to switch off bgscan. bgscan is now
turned on in COMPLETED, not ASSOCIATED.
2011-03-20 12:27:03 +02:00
Paul Stewart
5bbf9f1086 Add DBus state change notification for AuthMode property
Signed-off-by: Paul Stewart <pstew@google.com>
2011-03-15 13:54:59 +02:00
Paul Stewart
cf83fb0b5b wpa_supplicant: Add wpa_supplicant_get_eap_mode method
Signed-off-by: Paul Stewart <pstew@google.com>
2011-03-15 13:53:08 +02:00
Jouni Malinen
52c9e6f3f5 TDLS: Do not allow setup to be started if AP prohibits TDLS 2011-03-06 14:54:49 +02:00
Ganesh Prasadh
281ff0aa76 TDLS: Add initial support for TDLS (IEEE Std 802.11z-2010) 2011-03-06 14:53:49 +02:00
Jouni Malinen
9e0749737c Update copyright notices to include the new year 2011-02-27 12:50:00 +02:00
Ben Greear
48b84f18a3 Wait 1 second before (re)scanning on authentication timeout
If we timed out, the AP or the local radio may be busy.
So, wait a second until scanning again.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-02-24 17:16:16 +02:00
Ben Greear
e29853bbff SME: Add timers for authentication and asscoiation
mac80211 authentication or association operation may get stuck for some
reasons, so wpa_supplicant better use an internal timer to recover from
this.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-02-24 16:59:46 +02:00
Jouni Malinen
50b16da13f Fix CONFIG_NO_STDOUT_DEBUG=y build 2011-02-10 20:24:06 +02:00
Ben Greear
f049052b9e Use wpa_msg() instead of wpa_printf()
This converts number of debugging messages to use wpa_msg() in order
to allow the interface name to be shown with the messages.

A new function, wpa_dbg(), is introduced to allow
CONFIG_NO_STDOUT_DEBUG=y builds to remove the debug strings. This is
otherwise identical with wpa_msg(), but it gets compiled out if stdout
debugging is disabled.
2011-02-10 20:14:46 +02:00
Ben Greear
4f1495aefa Add interface name to wpa_msg() output
This makes log files much more readable if multiple interfaces
are being controlled by the same process. The interface name is
added to stdout/file/syslog entries, but not to the messages
sent to control interface monitors to avoid issues with parsing
in external programs.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-02-06 20:39:34 +02:00
Jouni Malinen
0382097ef3 Use set_key addr to distinguish default and multicast keys
Previously, both NULL and ff:ff:ff:ff:ff:ff addr were used in various
places to indicate default/broadcast keys. Make this more consistent
and useful by defining NULL to mean default key (i.e., used both for
unicast and broadcast) and ff:ff:ff:ff:ff:ff to indicate broadcast
key (i.e., used only with broadcast).
2011-01-09 19:44:28 +02:00
Jouni Malinen
da64c266e7 Use more consistent set_key seq value when nothing is being set
Use NULL instead of (u8 *) "" as the seq value and make sure the
driver wrapper implementations can handle NULL value. This was
previously already done in number of places, but not everywhere.
2011-01-09 12:09:04 +02:00
Jouni Malinen
5e8b237864 Fix CONFIG_SME build without CONFIG_IEEE80211W 2010-12-19 12:44:58 +02:00
Jouni Malinen
7d878ca769 Use SA Query procedure to recovery from AP/STA state mismatch
If a station received unprotected Deauthentication or Disassociation
frame with reason code 6 or 7 from the current AP, there may be a
mismatch in association state between the AP and STA. Verify whether
this is the case by using SA Query procedure. If not response is
received from the AP, deauthenticate.

This implementation is only for user space SME with
driver_nl80211.c.
2010-12-19 11:58:00 +02:00
Ben Greear
c577db2afd Add interface name to some debug prints
This makes it easier to figure out what is happening when controlling
multiple interfaces from a single wpa_supplicant process.
2010-11-26 21:16:36 +02:00
Jouni Malinen
871f4dd069 Allow driver wrappers to indicate whether result codes are sane
Some drivers are not providing exactly reliable error codes (e.g.,
with WEXT), but others may actually indicate reliable information.
Allow driver wrappers to indicate if that is the case and use
optimizations if so. For now, this improves nl80211 with
NL80211_CMD_CONNECT for a case where connection request fails.
2010-11-26 17:41:21 +02:00
Jouni Malinen
0fb337c121 Extend load balancing optimization in BSS blacklisting
Move the previously SME specific optimization code into generic
function that can be used from non-SME code, too, and use it to
handle disconnection events. In other words, allow disconnection
event to trigger similar optimized scanning case to handle a
common load balancing mechanism. If there is another BSS in the
same ESS when we receive a disconnection event, scan only the
known frequencies of such other BSSes on the next attempt to
speed up recovery.
2010-11-26 11:36:03 +02:00
Jouni Malinen
f47d639d49 SME: Optimize recovery from common load balancing mechanisms
When authentication or association fails when trying to connect to
a BSS in an ESS that has multiple BSSes based on previous scans,
limit the first recovery scan to only the known channels that has
been seen previously. This speeds up recovery in some of the most
commonly used load balancing mechanisms in enterprise WLAN
networks.
2010-11-25 22:51:56 +02:00
Samuel Ortiz
74b1c84a0b wpa_supplicant: Test all compiled drivers before failing
wpa_supplicant_set_driver() is returning an error if the first driver
in the driver list is not built in. It should continue through the
driver list until it finds one that's built in.
2010-11-09 16:45:27 +02:00
Felix Fietkau
99ac2913d8 wpa_supplicant: Fix port state management without IEEE8021X_EAPOL
If IEE8021X_EAPOL is not enabled in the config, wpa_drv_set_supp_port
must be called from the supplicant, otherwise port will not be
activated after association.
2010-11-09 16:31:33 +02:00
Jouni Malinen
2f9c6aa665 Fix memory leak in P2P build without MLME
The ieee80211_sta_free_hw_features() function is now used outside
the MLME code, so better make sure it gets included in the build
to avoid leaking memory.
2010-10-27 11:26:46 +03:00
Jouni Malinen
f19858f5a8 Show wpa_supplicant version number in the debug log 2010-10-22 11:50:34 +03:00
Jouni Malinen
c4ea4c5c90 P2P: Allow driver wrapper to indicate how many stations are supported
This can be used to limit the number of clients allowed to connect
to the group on the GO.
2010-09-09 07:17:21 -07:00
Jouni Malinen
eea2fd9eff P2P: Add mechanism for configuring UAPSD parameters for group
This is needed to be able to change parameters for dynamically
created interfaces between the creation of the interface and
association/start AP commands.

Following ctrl_interface commands can now be used:

P2P_SET client_apsd disable
- disable configuration (i.e., use driver default) in client mode

P2P_SET client_apsd <BE>,<BK>,<VI>,<VO>;<max SP Length>
- enable UASPD with specific trigger configuration (0/1) per AC
  (max SP Length is currently ignored)

P2P_SET go_apsd disable
- disable configuration (i.e., use driver default) in AP mode

P2P_SET go_apsd <0/1>
- disable/enable APSD in AP mode
2010-09-09 07:17:21 -07:00
Jouni Malinen
72044390f3 P2P: Add support for cross connection
If enabled, cross connection allows GO to forward IPv4 packets
using masquerading NAT from the P2P clients in the group to an
uplink WLAN connection. This is disabled by default and can be
enabled with "wpa_cli p2p_set cross_connect 1" on the P2P device
interface.
2010-09-09 07:17:20 -07:00
Jouni Malinen
4c08c0bd57 P2P: Include P2P IE in (Re)AssocReq to infra AP if it uses P2P IE
While this is not strictly speaking required by the P2P specification
for a not-P2P Managed Device, this can provide useful information for
the P2P manager AP and may be needed to pass certification tests.
2010-09-09 07:17:20 -07:00
Jouni Malinen
43a3863516 Trigger scan on reload-config only if there are enabled networks 2010-09-09 07:17:20 -07:00
Jouni Malinen
5f3a6aa0a4 P2P: Add P2P IE into (Re)Association Request frames 2010-09-09 07:17:17 -07:00
Jouni Malinen
6e3f4b89ea P2P: Let the driver wrapper know if association is for P2P group 2010-09-09 07:17:17 -07:00
Jouni Malinen
b22128efdc P2P: Add initial version of P2P Module 2010-09-09 07:17:17 -07:00
Jouni Malinen
fdadd5fe03 P2P: Do not register l2_packet on dedicated P2P device interface 2010-09-09 07:17:17 -07:00
Jouni Malinen
4dac02455a P2P: Use config block with disabled==2 to store persistent groups 2010-09-09 07:17:17 -07:00
Jouni Malinen
2c5d725c65 P2P: Add dynamic network config block parameters for P2P 2010-09-09 07:17:16 -07:00
Jouni Malinen
611aea7d41 Allow ctrl_iface SET command to change global config parameters 2010-09-09 07:17:16 -07:00
Jouni Malinen
0c80427d77 NDIS: Fix association for WPS provisioning with protected AP
Some NDIS drivers require a workaround to allow them to associate
with a WPS AP that is already using protection (Privacy field = 1).
Let driver_ndis.c know if the AP is already using Privacy and if so,
configure a dummy WEP key to force the driver to associate.
2010-09-04 13:56:12 +03:00
Jouni Malinen
09f58c0984 Share common code in wpa_supplicant_{disassociate,deauthenticate}() 2010-08-26 13:43:38 +03:00
Jouni Malinen
eb0a3c7f96 Cancel authentication timeout on local deauth/disassoc request
Without this, the timeout may be left behind even when we are not
connected and may result in unwanted operation when the timeout
triggers.
2010-08-26 13:39:58 +03:00
Jouni Malinen
8401a6b028 Add Linux rfkill support
Add a new wpa_supplicant state: interface disabled. This can be used
to allow wpa_supplicant to be running with the network interface even
when the driver does not actually allow any radio operations (e.g.,
due to rfkill).

Allow driver_nl80211.c and driver_wext.c to start while rfkill is in
blocked state (i.e., when ifconfig up fails) and process rfkill
events to block/unblock WLAN.
2010-05-23 10:27:32 +03:00
Kel Modderman
adc8d4a791 Fix enabling of networks while another network is being used
Enable a network block, even if there is a current configuration, if it
was disabled.

Signed-off-by: Kel Modderman <kel@otaku42.de>
2010-05-02 11:08:03 +03:00
Jouni Malinen
74e259ec7c Do not trigger initial scan if there are no enabled networks
This allows wpa_supplicant to be started quickly with an empty
configuration. If an external program wants to fetch scan results
from wpa_supplicant, it will need to request a scan explicitly
in this type of case.
2010-04-16 18:56:23 +03:00
Jouni Malinen
508545f3a9 Add more wpa_supplicant AP mode parameters for the driver wrapper
This makes it easier to configure AP mode for drivers that take care
of WPA/RSN IE generation.
2010-04-11 20:02:01 +03:00
Jouni Malinen
814782b9fe Allow driver wrappers to indicate maximum remain-on-channel duration 2010-04-11 19:42:37 +03:00
Jouni Malinen
17a4734dc4 Optimize post-WPS scan based on channel used during provisioning
Scan only the frequency that was used during provisioning during the
first five scans for the connection. This speeds up connection in the
most likely case where the AP remains on the same channel. If the AP is
not found after these initial scans, all channels will be scanned.
2010-04-11 19:06:42 +03:00
Jouni Malinen
e7846b6859 FT: Clean up wpa_sm_set_ft_params() by using common parse
Instead of parsing the IEs in the callers, use the already existing
parser in wpa_ft.c to handle MDIE and FTIE from initial MD association
response. In addition, this provides more complete access to association
response IEs to FT code which will be needed to fix FT 4-way handshake
message 2/4.
2010-04-10 11:36:35 +03:00
Jouni Malinen
76b7981d07 FT: Copy FT Capability and Policy to MDIE from target AP
This sets the FT Capability and Policy field in the MDIE to the values
received from the target AP (if available). This fixes the MDIE contents
during FT Protocol, but the correct value may not yet be used in initial
mobility domain association.
2010-04-09 16:26:20 +03:00
Jouni Malinen
e820cf952f MFP: Add MFPR flag into station RSN IE if 802.11w is mandatory 2010-03-29 10:48:01 -07:00
Jouni Malinen
dff0f701d0 Preparations for v0.7.1 release 2010-01-16 19:04:38 +02:00
Marcel Holtmann
27f43d8de5 dbus: Replace StateChanged with PropertiesChanged signal
The actual supplicant state is exposed via a property on the interface
object. So having a separate signal StateChanged for notifying about
changes is a bad idea. The standard PropertiesChanged signal should be
used for this.

The advantage of StateChanged signal was that it includes the previous
state, but not even NetworkManager is making use of this. And tracking
the old state via the property and this signal is easily possible anyway.
2010-01-04 16:33:44 +02:00
Jouni Malinen
abd9fafab6 Standardize on a single definition of auth_alg bitfield values 2010-01-03 21:14:40 +02:00
Jouni Malinen
70f8cc8ec8 Share the same enum for MFP configuration
The three existing enums were already depending on using the same
values in couple of places and it is just simpler to standardize on
one of these to avoid need for mapping between different enums for
the exact same thing.
2010-01-03 21:02:51 +02:00
Jouni Malinen
9ba9fa07cc Move wpa_supplicant specific scan code away from src/drivers
This fits better in wpa_supplicant/scan.c. Couple of remaining
scan_helpers.c functions are currently used in driver wrappers,
but they can likely be removed in the future.
2010-01-03 18:48:11 +02:00
Jouni Malinen
a8e0505bf0 Use driver event, EVENT_EAPOL_RX, for EAPOL frame indication 2010-01-03 17:44:40 +02:00
Jouni Malinen
245519e0cd Replace wpa_supplicant_sta_rx() call with driver event
Get rid of wpa_supplicant_sta_rx() and add a new driver event that is
marked to be used only with driver_test.c. In addition, remove this
functionality from privsep wrapper. This is only use for client mode
MLME testing with driver_test.c.
2010-01-03 11:50:26 +02:00
Jouni Malinen
8f770587d9 Maintain a pointer to the current BSS table entry 2010-01-02 16:59:19 +02:00
Jouni Malinen
a1fd2ce54e Do not store raw scan results
Use scan results to update the BSS table and to select the BSS for
connection, but do not store the results for longer time.
2010-01-02 16:41:38 +02:00
Jouni Malinen
6fa81a3b3f Use BSS table entry instead of raw scan result for connection 2010-01-02 16:16:02 +02:00
Jouni Malinen
8d923a4acf Only expire scanned BSSes based on new scan results
Get more information about scans when updating BSS table information.
This allows the missing-from-scans expiration rule to work properly
when only partial set of channels or SSIDs are being scanned.
2010-01-02 13:57:44 +02:00
Witold Sowa
db9133acb2 dbus: Divide DebugParams property to three separate properties 2010-01-01 13:00:22 +02:00
Jouni Malinen
8e56d18993 dbus: Fix D-Bus network and BSS object registration/unregistration
Do not try to unregister BSS objects twice (the latter one with invalid
path) and make sure all network objects get added and removed properly
(the ones read from configuration file were not being registered, but
were tried to be unregistered).
2009-12-29 22:17:18 +02:00
Jouni Malinen
d7dcba70bc Define struct wpa_ssid::mode as an enum with more readable values 2009-12-28 16:00:36 +02:00
Jouni Malinen
34359a3fb1 Include BSS table unconditionally in the wpa_supplicant build
This will allow more cleanup to be done for scan results processing
since all code can now be made to depend on the BSS table instead of
the temporary scan results.

Once remaining code has been converted to use the BSS table, the new
scan results can be freed immediately after the BSS table has been
updated. In addition, filtering of BSS information should be added
to better support systems with limited resources. For now, memory
use can be limited by defining WPA_BSS_MAX_COUNT to be smaller.
Anyway, better filtering of results to only the configured networks
should be added to improve this.
2009-12-28 01:14:56 +02:00
Jouni Malinen
83922c2d34 Add BSS table to track scan results without dropping information
Collect information from scan results into a BSS table that will not
expire information as quickly as scan results where every new scan,
no matter for how limited set of channels/SSIDs, clears all old
information.

For now, this is only used for D-Bus BSS added/removed notifications,
but this will likely be extended to be used internally instead of the
scan results to better support partial scans.
2009-12-27 21:07:47 +02:00
Jouni Malinen
2ee055b3c0 Indicate interface removal only if the interface was added successfully 2009-12-26 13:45:07 +02:00
Jouni Malinen
719347511a Get rid of unnecessary typedefs for enums. 2009-12-26 10:35:08 +02:00
Jouni Malinen
a5b9337fc8 Avoid NULL dereference on error path when default driver is used 2009-12-23 23:16:21 +02:00
Jouni Malinen
1a1bf008cb WPS ER: Delay wpa_supplicant termination to allow unsubscription
Instead of forcefully deinitializing ER immediately, give it some
time to complete unsubscription and call eloop_terminate() only once
ER code has completed its work.
2009-12-19 23:47:54 +02:00
Jouni Malinen
0456ea16d8 eloop: Remove global user data pointer
This is not really needed since all signal handlers can use a context
pointer provided during signal handler registration.
2009-12-19 19:22:16 +02:00
Jouni Malinen
c302f20740 Initialize new_connection = 1 to fix wpa_supplicant AP mode operstate
When setting up an AP with wpa_supplicant, the initial connection was
not necessarily setting oper state from DORMANT to UP which would be
blocking normal data frames. Fix this by initializing new_connection
to 1 so that even the first change to COMPLETED state will end up
setting oper state.
2009-12-15 13:17:56 +02:00
Jouni Malinen
127608152e Move EAP method registration away from src/eap_{peer,server}
This makes it easier to make a library out of EAP methods without
losing possiblity of binary size optimization by linker dropping
unreferenced code.
2009-12-06 11:28:41 +02:00
Jouni Malinen
9c972abb66 IBSS RSN: Wait for connection event and do not use auth timeout
Wait for connection (IBSS join completed) event before marking state
completed. In addition, do not use the station mode authentication
timeout since that can trigger full disconnection from IBSS when
there is a timeout with just one of the peers.
2009-12-04 22:09:06 +02:00
Jouni Malinen
5cc4d64bf2 nl80211: Add support for IBSS networks 2009-12-04 00:15:32 +02:00
Jouni Malinen
d8222ae38c Fix driver initialization not to crash if driver does not use init2()
8a5ab9f5e5 fixed global driver context
for init2(), but it also broke driver initialization with driver
wrappers that do not use init2().. Fix this by setting wpa_s->global
before it gets dereferenced.
2009-12-02 16:43:09 +02:00
Jouni Malinen
3acb50056c Remove src/rsn_supp from default header path 2009-11-29 18:28:08 +02:00
Jouni Malinen
90973fb2fd Remove src/common from default header file path
This makes it clearer which files are including header from src/common.
Some of these cases should probably be cleaned up in the future not to
do that.

In addition, src/common/nl80211_copy.h and wireless_copy.h were moved
into src/drivers since they are only used by driver wrappers and do not
need to live in src/common.
2009-11-29 17:51:55 +02:00
Jouni Malinen
8a5ab9f5e5 Fix init2() driver_ops to get the correct global driver context
Need to provide the private driver context, not the wpa_supplicant
global context, in init2() call.
2009-11-28 18:11:16 +02:00
Jouni Malinen
ec8d20187d Remove obsoleted get_scan_results() driver_ops
This has now been replaced with get_scan_results2() in every
in-tree driver.
2009-11-23 21:33:37 +02:00
Jouni Malinen
4a867032ae Remove deprecated driver_ops handlers
This gets rid of previously deprecated driver_ops handlers set_wpa,
set_drop_unencrypted, set_auth_alg, set_mode. The same functionality
can be achieved by using the init/deinit/associate handlers.
2009-11-23 20:22:38 +02:00
Witold Sowa
71f6e1f697 Add notifications for scan result BSS changes (added/removed)
If scan results introduce new BSSs or discards some previously known,
new wpas_notify_bss_added or wpas_notify_bss_removed notifications are
called.
2009-11-11 17:07:53 +02:00
Jouni Malinen
a1641d2671 Call wpas_notify_network_selected only if a specific network was selected
ssid could be NULL here at least based on the function documentation,
so better check whether that is the case prior to calling the
notification function.
2009-11-10 18:06:02 +02:00
Jouni Malinen
d27df100b5 Allow driver and ctrl_interface parameters to be overridden
New wpa_supplicant command line options -o<driver> and -O<ctrl> can
now be used to override the parameters received in add interface
command from dbus or global ctrl_interface. This can be used, e.g.,
to enable control interface when using NetworkManager (add
-O/var/run/wpa_supplicant into the Exec parameter in
/usr/share/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service).
Similarly, this can be used to use another driver wrapper with
NetworkManager (e.g., -onl80211 to replace WEXT with nl80211).
2009-11-04 20:16:15 +02:00
Witold Sowa
dc461de43e wpa_supplicant and dbus code separation
This patch completely separates supplicant's code from dbus.
It introduces three new notifications which copes with all
remaining dbus stuff.
wpas_notify_unregister_interface() was renamed to
wpas_notify_iface_removed().
2009-10-15 21:15:10 +03:00
Masashi Honma
0e27f655f1 MFP: Clear IGTK
The fourth and fifth keys are used as IGTK for management frame
protection. This patch clears these keys.

I have tested with linux kernel 2.6.31.2.
2009-10-12 07:19:01 +03:00
Johannes Berg
0194fedb46 driver_nl80211: Fix MLME key settings for static WEP
Current wpa_supplicant has a bug with WEP keys, it adds a zero-length
sequence counter field to netlink which the kernel doesn't accept.

Additionally, the kernel API slightly changed to accept keys only when
connected, so we need to send it the keys after that. For that to work
with shared key authentication, we also include the default WEP TX key
in the authentication command.

To upload the keys properly _after_ associating, add a new flag
WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE indicating that the driver
needs the keys at that point and not earlier.
2009-09-15 10:48:30 +03:00
Jouni Malinen
60b94c9819 Add preliminary background scan and roaming module design
This allows background scanning and roaming decisions to be contained in
a single place based on a defined set of notification events which will
hopefully make it easier to experiment with roaming improvements. In
addition, this allows multiple intra-ESS roaming policies to be used
(each network configuration block can configure its own bgscan module).

The beacon loss and signal strength notifications are implemented for
the bgscan API, but the actual events are not yet available from the
driver.

The included sample bgscan module ("simple") is an example of what can
be done with the new bgscan mechanism. It requests periodic background
scans when the device remains associated with an ESS and has couple of
notes on what a more advanced bgscan module could do to optimize
background scanning and roaming. The periodic scans will cause the scan
result handler to pick a better AP if one becomes available. This bgscan
module can be taken into use by adding bgscan="simple" (or
bgscan="simple:<bgscan interval in seconds>") into the network
configuration block.
2009-09-15 00:08:24 +03:00
Witold Sowa
3e53b314f5 Share same freeing and error checking code in get_scan_results
Convert wpa_supplicant_get_scan_results_old() to use the same return
style with the other get_scan_results options and clean up the code
by sharing the same scan result freeing and error checking code for
all the options.
2009-09-13 22:21:52 +03:00
Witold Sowa
86b89452f6 Use shared functions for network operations and param changes
Instead of implementing these separately in various control
interface handlers, use shared functions. These add some of the
previously missing notification calls, too, for the affected areas.
2009-09-13 21:16:43 +03:00
Jouni Malinen
8bac466b00 Add wpa_supplicant notification calls
This introduces a new mechanism for collecting notification calls into
a single place (notify.c). As a result of this, most of the
wpa_supplicant code does not need to know about dbus (etc. mechanisms
that could use the notifications). Some empty placeholder functions are
also added in preparation of new dbus code that needs more event
notifications.
2009-09-13 20:53:32 +03:00
Witold Sowa
1bd3f426d3 Remove extra whitespace 2009-09-13 20:27:54 +03:00
Jouni Malinen
1ff733383f Delay processing of EAPOL frames when not associated
If an EAPOL frame is received while wpa_supplicant thinks the driver is
not associated, queue the frame for processing at the moment when the
association event is received. This is a workaround to a race condition
in receiving data frames and management events from the kernel.

The pending EAPOL frame will not be processed unless an association
event is received within 100 msec for the same BSSID.
2009-09-04 18:04:41 +03:00