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>
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>
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>
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>
Move the roam event counters to a dedicated struct.
Update the ubus output to represent this new organization.
Signed-off-by: David Bauer <mail@david-bauer.net>
Save the timestamp of the node creation. This is required to optimize
the selection of most-roamed to neighbors relative to their creation
time.
Signed-off-by: David Bauer <mail@david-bauer.net>
Keep track of STA journeys between multiple nodes. When a new STA is
reported from a foreign node, check whether this STA was previously
associated with a local node.
Vice versa, check upon association whether or not the STA was previously
associated with a foreign node.
Keep track of these roaming transactions using two new (local) fields of
the node struct.
Signed-off-by: David Bauer <mail@david-bauer.net>
Add a last_connected field to the sta_info struct. This field can be
used to determine, if and when a client was last connected to a given
node. This way, other nodes can determine where a client roamed to or
from.
Signed-off-by: David Bauer <mail@david-bauer.net>
This commit fixes updates not triggering due to a race-condition in
usteer.
When usteer does not yet have local-nodes when loading config, the
scheduled remote-update is not re-scheduled, leading to usteer only
exchanging node-messages on STA-events, leading to expiring remotes on
other remote nodes in low-event scenarios.
Signed-off-by: David Bauer <mail@david-bauer.net>
Add the node BSSID to messages exchanged between usteer hosts. This way,
a foreign node can determine the node reported by a STA using beacon
reports.
Signed-off-by: David Bauer <mail@david-bauer.net>
The host address is allocated on the heap, hence it has to be freed when
freeing the containing struct.
Signed-off-by: David Bauer <mail@david-bauer.net>
When checking if the hostaddresses match up, the result returned from
strcmp was incorrectly evaluated. strcmp returns 0 in case both strings
match.
Signed-off-by: David Bauer <mail@david-bauer.net>
This adds optional support for message exchange using IPv6 multicast
messaging. This has the ability for routers and switches between nodes
to route traffic between usteer nodes multicast-aware.
By default, IPv4 is used. IPv6 can be enabled by configuring the ipv6
option to 1.
Signed-off-by: Jan Braun <keksgesicht23@gmail.com>
[squash commits - adapt usock usage]
Signed-off-by: David Bauer <mail@david-bauer.net>
- make logging events more structured
- add fine grained control over log events
- make it possible to receive more detailed events via ubus
Signed-off-by: Felix Fietkau <nbd@nbd.name>