Fix Coverity Scan CID 1521041 reporting a not closed FILE on fread fail.
Correctly close the FILE on fread fail to fix this leak.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
- Drop seen / last-connected as the list only contains currently
connected clients
- Convert past timestamps to relative age
- Include current roam-sm state
Signed-off-by: David Bauer <mail@david-bauer.net>
Don't alter roam-sm stats when remaining idle. Previously, a
roam-sm-event was registered when keeping the idle-state.
Signed-off-by: David Bauer <mail@david-bauer.net>
Always increase the kick-counter when usteer de-associates a STA. This
was previously exclusively done when kicking clients due to insufficient
SNR.
Signed-off-by: David Bauer <mail@david-bauer.net>
Usteer imposes minimum intervals for steering actions in order to avoid
creating endless roam-kick loops due to the decentral aspect of usteer.
Make these basic limits to roamsteering usable across band-steering and
signal-based roam-steering.
Signed-off-by: David Bauer <mail@david-bauer.net>
Onky trigger the roaming-sm after a client becomes roamable. This is the
case when a STA is connected for longer than roam_trigger_interval.
Signed-off-by: David Bauer <mail@david-bauer.net>
Fetch the age of the association for STAs in order to implement minimum
intervals after which a STA is considered kickable.
Signed-off-by: David Bauer <mail@david-bauer.net>
Query client MBO support from hostapd and display it in the output of
the connected_clients ubus method as "multi-band-operation".
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
As probe steering only makes sense in specific deployments, it should be
disabled by default.
Update the example config to reflect this change.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: David Bauer <mail@david-bauer.net>
Probe suppression is mostly useful in high density deployments, where
all APs responding to all client probes would result in all channels
being saturated. It effectively hides APs from clients, and can cause
problems in normal density deployments.
Add an option for it, so it can be disabled.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: David Bauer <mail@david-bauer.net>
Increasing ev.type by one for these event types works due to the order
of the elements in enum uevent_type, but makes the code harder to
understand and debug. Imagine seeing the following event log:
Mon Jun 27 22:08:43 2022 user.info usteer: usteer event=probe_req_deny node=hostapd.wl24-iot sta=e4:5f:01:00:92:b6 reason=better_candidate signal=-79 assoc=1 load=27 select_reason=signal remote=fe80::b2a7:b9ff:fecb:eeba#hostapd.wl24-iot remote_signal=-39 remote_assoc=13 remote_load=20
Trying to find probe_req_deny (UEV_PROBE_REQ_DENY) in the code will not
yield any useful results. Assigning the enum element to ev.type makes it
much easier to find where exactly the above log event comes from.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: David Bauer <mail@david-bauer.net>
As load-balancing only makes sense in specific deployments, it should be
disabled by default.
Update the example config to reflect this change.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: David Bauer <mail@david-bauer.net>
Load-balancing only makes sense where multiple APs are deployed in the
same area. Enabling load-balancing between APs in different rooms might
steer clients to APs with a much lower signal strength, resulting in
lower data rates and inefficient use of airtime.
Allow disabling load balancing by setting the threshold to 0.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: David Bauer <mail@david-bauer.net>
The candidate is never set in this loop. Fix it by setting it
to the first valid entry.
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@westermo.com>
The roam-kick-delay was not honored prior this patch. Because of this, a
client got kicked immediately.
Signed-off-by: David Bauer <mail@david-bauer.net>
Only send the preferred candidate with a BSS transition request.
Otherwise, unsuitable candidates might be included in the neighbor-list
of a transition request.
Signed-off-by: David Bauer <mail@david-bauer.net>
Send link-measurement requests to every supporting local-sta in order to
acquire information to assess the link-quality bi-directional.
The link-measurement request is sent each configurable interval. It can
be disabled by configuring the interval to 0.
Signed-off-by: David Bauer <mail@david-bauer.net>
If the timeout is not reset here, it will expire based on its initial
creation regardless whether it was updated in the meantime.
Signed-off-by: David Bauer <mail@david-bauer.net>
Generalize measurement handling in a way that RCPi and RSNI are stored
regardless of the specific measurement type. This allows us to handle
link-measurement reports the same way as we already handle
beacon-reports.
Signed-off-by: David Bauer <mail@david-bauer.net>
Request hostap to enable the link-measurement capability in the BSS
beacons. Otherwise, STAs might reject link-measurement requests despite
being capable of performing such.
Signed-off-by: David Bauer <mail@david-bauer.net>
This adds a new band-steering component to usteer.
With band-steering enabled, usteer will attempt to move clients with a
consistently good SNR / signal from 2.4 GHz to the 5 GHz band.
In contrast to existing policies usteer tracks, band-steering is
non-invasive and will not lead to forceful connection termination.
Signed-off-by: David Bauer <mail@david-bauer.net>
Add a timeout in case a STA rejected a transition request. For this
configurable timeframe, usteer will refrain from steering the client
another time.
Signed-off-by: David Bauer <mail@david-bauer.net>
While usteer tries it's best to determine the availability of a better
node for a certain client, it might still attempt to direct the client
to a unsuitable AP.
Transition away from using BSS-Transition-Requests with the
disassoc-imminent bit set and instead unset this bit.
This way, the client can inform the AP it will not transition to a
different BSS but instead wishes to remain connected to the current AP.
usteer will still kick clients in case they either accepted the
BSS-transition-request and do not roam or ignore the request completely.
Signed-off-by: David Bauer <mail@david-bauer.net>
This prevents communication with other usteer nodes and allows it to be
used for purely local band steering / load balancing
Signed-off-by: Felix Fietkau <nbd@nbd.name>
BSS transition management as well as RRM capabilities have to be
considered not for the STA but per STA connection.
Most prominently, a STA might not support BSS-TM when connected without
PMF.
Signed-off-by: David Bauer <mail@david-bauer.net>
This causes segfaults on OpenWrt 21.02 which is missing the op-class
field.
Reported-by: John Crispin <john@phrozen.org>
Signed-off-by: David Bauer <mail@david-bauer.net>
Save the latest BSS-transition management response received from a STA.
This information can later be used to prevent kicking STAs when they
rejected a transition request.
Signed-off-by: David Bauer <mail@david-bauer.net>
Add a method to obtain local-host specific state data about usteers
internal logic for each connected STA.
Signed-off-by: David Bauer <mail@david-bauer.net>
Add logic for saving measurement-reports from STAs.
This commit does not yet save the measurement-reports received from
clients but adds the necessary code to do so. Currently the codes can
only handle beacon-reports, but link measurements can be added to it in
the future.
It also adds the new config-key measurement_report_timeout which
controls how long measurements are saved upon they are received by a
STA.
Signed-off-by: David Bauer <mail@david-bauer.net>
Add methods which returns a given node for a provided BSSID. This is
required to retrieve the node object from information available with
a neighbor report.
Signed-off-by: David Bauer <mail@david-bauer.net>
In order to send passive beacon-requests, channel and op-class of nodes
are required. Obtain this information per local-node from hostapd.
Signed-off-by: David Bauer <mail@david-bauer.net>