It is possible for there to be multiple FST groups, so the hardcoded
mechanism of selecting the first one when sending out an event message
may not be sufficient. Get the interface from the caller, if available,
and if not, go through all groups in search of an interface to send the
event on.
Signed-off-by: Jouni Malinen <j@w1.fi>
It is possible for there to be multiple FST groups, so the hardcoded
mechanism of selecting the first one when sending out an event message
may not be sufficient. Get the interface from the caller, if available,
and if not, go through all groups in search of an interface to send the
event on.
Signed-off-by: Jouni Malinen <j@w1.fi>
Now that both hostapd and wpa_supplicant already enforce no duplicate
fst_attach() calls, there is no need for this check within fst_attach().
Signed-off-by: Jouni Malinen <j@w1.fi>
Dialog token is only 8 bits and maintaining u32 version of it in struct
fst_group resulted in incorrect wrap-around behavior in
fst_group_assign_dialog_token(). It was possible to assign u8
dialog_token value 0 because of this. Fix this by using u8 variable
consistently.
Signed-off-by: Jouni Malinen <j@w1.fi>
While this is always supposed to be the first element, check that this
is indeed the case instead of blindly using values from within the
element.
Signed-off-by: Jouni Malinen <j@w1.fi>
The Element ID and Length subfields are not supposed to be included in
the Length. In addition, both of these subfields needs to be filled in
even for non-zero status code cases.
Signed-off-by: Jouni Malinen <j@w1.fi>
This extends the previous PMF (CONFIG_IEEE80211W=y) design that used
functionality from the FT (CONFIG_IEEE80211R=y) changes to work without
requiring CONFIG_IEEE80211R=y build option to be included.
Signed-off-by: Ashok Ponnaiah <aponnaia@qti.qualcomm.com>
It was possible for a registered eloop socket handler to be unregistered
and re-registered for a re-opened socket with the same fd from a timeout
or signal handler. If such a case happened with the old socket having a
pending event waiting for processing, some eloop combinations could end
up calling the new handler function with the new socket and get stuck
waiting for an event that has not yet happened on the new socket. This
happened with timeout and signal handlers with all eloop.c types. In
addition to that, the epoll case could also trigger this when a socket
handler re-registered a re-opened socket.
Fix these by checking whether there has been socket handler changes
during processing and break the processing round by going back to
select/poll/epoll for an updated result if any changes are done during
the eloop handler calls before processing the old socket results.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
It was possible for the SIGINT/SIGTERM signal to be received while
processing a pending timeout/socket/signal event and then get stuck in
the following select() call before processing the signal event. If no
other events show up within the two second SIGALRM trigger, process will
be terminated forcefully even though there would have been possibility
to do clean termination assuming no operationg blocked for that two
second time.
Handle this more cleanly by checking for eloop.pending_terminate before
starting the select()/poll()/epoll_wait() wait for the following event.
Terminate the loop if pending signal handling requests termination.
In addition, make eloop_terminated() return 1 on eloop.pending_terminate
in addition to eloop.terminate since the process will be terminated
shortly and there is no point in starting additional processing.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Introduce definitions for QCA vendor specific subcommands and attributes
to support multiport concurrency.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This new mechanism can be used to combine multiple periodic AP
(including P2P GO) task into a single eloop timeout to minimize number
of wakeups for the process. hostapd gets its own periodic caller and
wpa_supplicant uses the previously added timer to trigger these calls.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Previously, one timeout per process (by default every 30 seconds) was
used P2P peer expiration and another per-interface timeout (every 10
seconds) was used to expire BSS entries. Merge these to a single
per-process timeout that triggers every 10 seconds to minimize number of
process wakeups due to periodic operations.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Previously, this resulted in unnecessary wait and retransmission of the
previous EAP-Request. Change that to trigger immediate transmission of
EAP-Failure and disconnection since the EAP method cannot really recover
from this state.
Signed-off-by: Jouni Malinen <j@w1.fi>
This functionality was removed from the Host AP driver in May 2003, so
there is not any point in maintaining this in hostapd either.
Signed-off-by: Jouni Malinen <j@w1.fi>
The space separator between the command and the parameter was not
skipped properly and the first integer ended up being interpreted as 0
in all cases.
Signed-off-by: Jouni Malinen <j@w1.fi>
fst_session_is_in_progress() is already checked as part of
fst_find_session_in_progress() before calling
fst_session_handle_action(). This is the only call path that can reach
fst_session_handle_tear_down() and as such, fst_session_is_in_progress()
cannot return 0 here.
Signed-off-by: Jouni Malinen <j@w1.fi>
There was a mix of EINVAL and -EINVAL returns through the FST
implementation. Make this more consistent by always returning -EINVAL in
error cases.
Signed-off-by: Jouni Malinen <j@w1.fi>
The caller is not expected to free or modify the value since this is
returning a reference to a buffer maintained by the upper layer.
Signed-off-by: Jouni Malinen <j@w1.fi>
There is no need to add new functions with more or less identical
functionality of an already available helper function.
Signed-off-by: Jouni Malinen <j@w1.fi>
This extends the hostapd global control interface ADD command to allow
driver wrapper to be specified ("ADD <ifname> <ctrl_iface> <driver>").
Previously, this case that did not use a configuration file allowed only
the default driver wrapper to be used.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This experimental support for Texas Instruments C compiler was never
fully completed and it has not really been used in close to ten years,
so drop this to simply the header files.
Signed-off-by: Jouni Malinen <j@w1.fi>
Use a local variable and check the record payload length validity before
writing it into record->payload_length in hopes of getting rid of a
bogus static analyzer warning. The negative return value was sufficient
to avoid record->payload_length being used, but that seems to be too
complex for some analyzers. (CID 122668)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Typecasting &mgmt->u.action.u.fst_action to a struct pointer for various
FST Action frame payloads seemed to be triggering static analyzer
warnings about bounds checking since sizeof(mgmt->u.action.u.fst_action)
== 1 even though that is really a variable length structure. Try to
avoid this by calculating the pointer for the beginning of the frame
instead of variable length struct. (CID 125642)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
It was possible for the previously set SSID to remain in place between
test cases (e.g., in sequence "p2ps_connect_adv_go_persistent
p2p_set_ssid_postfix") and the P2P SSID postfix not getting used
properly. Make this less likely to occur by clearing the old SSID in
p2p_flush().
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
These are confusing when the style used with the couple of FST IE checks
differs from the rest of hostapd/wpa_supplicant implementation.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
There is no need for this function to be an inline function in a header
file since it is used only within fst_group.c.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Commit 717333f4e4 ('FST: Add the Fast
Session Transfer (FST) module') performed incorrect frame length
validation for Setup Request (did not remove 24+1 header from
consideration) and did not include payload validation for other FST
Action frames. Fix these by explicitly verifying that the payload of
these frames is sufficiently long before reading the values from there.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
There is no need to waste resources for this packet socket if FT-over-DS
is disabled or when operating P2P GO or AP mode in wpa_supplicant.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This adds the FST IEs received from the FST module into Beacon, Probe
Response, and (Re)Association Response frames.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Fast Session Transfer (FST) is the transfer of a session from a channel
to another channel in a different frequency band. The term "session"
refers to non-physical layer state information kept by a pair of
stations (STAs) that communicate directly (i.e., excludes forwarding).
The FST is implemented in accordance with IEEE Std 802.11ad-2012.
Definitions
* FST interface - an interface for which FST functionality is enabled
* FST group - a bunch of FST interfaces representing single
multi-band STA
* FST peer - a multi-band capable STA connected
* FST module - multi-band operation functionality implemented in
accordance with IEEE Std 802.11ad-2012 (see 10.32
Multi-band operation) as a part of hostapd/wpa_supplicant
* FST manager - an external application that implements custom FST
related logic, using the FST module's interfaces
accessible via CLI or D-Bus
This commit introduces only the FST module. Integration of the FST
module into the hostapd/wpa_supplicant and corresponding CLI/D-Bus
interfaces and FST related tests are covered in separate commits.
FST manager application is out of scope of these commits.
As FST aggregates a few interfaces into FST group, the FST module uses
global CLI for both commands and notifications. It also exposes
alternative non-interface based D-Bus subtree for this purposes.
Configuration and Initialization
* FST functionality can enabled by compilation flag (CONFIG_FST)
* hostapd/wpa_supplicant controlling multiple interfaces are used for
FST
* once enabled by compilation, the FST can be enabled for specific
interfaces in the configuration files
* FST interfaces are aggregated in FST groups (fst_group_id config file
entry), where each FST group:
- represents one multi-band device
- should have two or more FST interfaces in it
* priority (fst_priority config file entry) must be configured for each
FST interface. FST interface with higher priority is the interface FST
will always try to switch to. Thus, for example, for the maximal
throughput, it should be the fastest FST interface in the FST setup.
* default Link Loss Timeout (LLT) value can be configured for each FST
interface (fst_llt config file entry). It represents LLT to be used
by FST when this interface is active.
* FST interfaces advertise the Multi-band capability by including the
Multi-band element in the corresponding frames
FST CLI commands:
* fst list_groups - list FST groups configured.
* fst list_ifaces - list FST interfaces which belong to specific group
* fst iface_peers - list Multi-Band STAs connected to specific interface
* fst list_sessions - list existing FST sessions
* fst session_get - get FST session info
* fst session_add - create FST session object
* fst session_set - set FST session parameters (old_iface, new_iface,
peer_addr, llt)
* fst session_initiate - initiate FST setup
* fst session_respond - respond to FST setup establishemnt attempt by
counterpart
* fst session_transfer - initiate FST switch
* fst session_teardown - tear down FST Setup but leave the session object
for reuse
* fst session_remove - remove FST session object
FST CLI notifications:
* FST-EVENT-PEER - peer state changed (CONNECT/DISCONNECT)
* FST-EVENT-SESSION - FST session level notification with following
sub-events:
- EVENT_FST_SESSION_STATE - FST session state changed
- EVENT_FST_ESTABLISHED - previously initiated FST session became
established
- EVENT_FST_SETUP - new FST session object created due to FST session
negotiation attempt by counterpart
All the FST CLI commands and notifications are also implemented on D-Bus
for wpa_supplicant.
IEEE 802.11 standard compliance
FST module implements FST setup statemachine in compliance with IEEE
802.11ad (P802.11-REVmc/D3.3), as it described in 10.32 Multi-band
operation (see also Figure 10-34 - States of the FST setup protocol).
Thus, for example, the FST module initiates FST switch automatically
when FST setup becomes established with LLT=0 in accordance with
10.32.2.2 Transitioning between states.
At the moment, FST module only supports non-transparent STA-based FST
(see 10.32.1 General).
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>