Fixes errors in the form of:
dawn: mem-audit: Releasing memory we hadn't registered (tcpsocket.c:142)...
dawn: mem-audit: attempted to register memory already registered (M@tcpsocket.c:114)...
Fixes: 850a75c182 ("fix compilation with GCC12")
Signed-off-by: Nick Hainke <vincent@systemli.org>
Tidy up a few bits of code - nothing very significant.
Documentation fixes and updates
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
Modifications to BEACON and PROBE handling to improve understanding of
RSSI and RCPI / RSNI values. Also address bugs in frequency / band handling.
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
Updated approach to sending BEACON REQUEST. Each AP asks every 802.11k
enabled client for the BEACON REPORT of a single other AP in the network
at N second intervals, where N is the refresh period / num-APs. N seconds
later the request is sent for the next AP.
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
In addition to scored "hard" kick for all clients (inc. legacy), add a "soft"
kick for 802.11v aware clients by always asking them to move if below
threshold RSSI, but with no mandatory disassociation.
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- Simplify how score is tracked
- Streamline some code paths for scoring evaluation to reduce data searches, etc
- Allow more entries to be considered for AP NR
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- Revise some messages so meaning is clearer
- Fix some whitespace, etc
- Simplify a coiuple of small functions
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- Tweak disassociate / kick NR code to reduce build overhead
- Add set_hostapd_nrdynamic == 2 to build of AP local station NR from what current clients hear elsewhere
- Tighten up hex string length usage for strncpy(), etc
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- Add dawn_mutex_require() to indicate when code is accessing resources
- Use pthread_mutex_trylock() to actively test required mutex are locked
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- Tighten up a bit of test path coding
- Add some test scripts (not fully revised for current code)
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- Fix a couple of bugs in hardly ever (never?) used code paths that Coverity spotted
- Add comments for things that look a bit odd, but not sure if they are bugs
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
Add messages that help users understand what PROBE and BEACON messages
are being used.
Remove a few things that are no longer needed: #includes, etc
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- Merge encoded / plain messge handling to ensure fixes land in both
- Fix some potential resource leaks spotted by Coverity
[cleanup commit message]
[fix merge conflicts]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- Simplify linked list search - code was unnecessarily complex for no benefit
- Refactored parse / kick logic to simplify functions
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- New skipping linked list structure - possible bug in previous version
- Adjust some function names to better reflect what actually happens
- Remove redundant configurable sort elements
- Remove probe structure SSID field which is not set via BEACON, so is unreliable
- Adjust way the different fields from BEACON and PROBE reports are handled / merged
- Made client / BSSID paramater order consistent for probe / beacon functions to help avoid cut/ paste bugs
- Add RRM capability, RCPI and RSNI to client in hearing map (which is a summary of probe / beacon entries)
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- Simplify linked list search - code was unnecessarily complex for no benefit
- AP record is uniquely identified by BSSID, so remove unnecessary search on SSID as well
- Change some data handling to simplify passing of records, pointers, etc
- Assure sort order to simplify generating network map
- Removed unused fields for collision domain and bandwidth
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- Simplify linked list search - code was unnecessarily complex for no benefit
- Adjust some MAC address handling to simplify code
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- Remove the linked list of rejected auth / assoc as it was not used for any decision making
- Rename auth_req to client_req as it is also used by association requests
[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
- README.md: Top level intro
- INSTALL.md: Typical user installation
- CONFIGURE.md: Detailed description of how parameters work together, and how to set each one
- DEVELOPER.md: How to build a local version, some notes on dev time "helpers", etc
[fix commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
OpenWrt's hostapd now supports the more generic "bss_transition_request"
method that allows initiating a BSS transition request with the
Disassociation Imminent bit not set. Use this new method instead of
"wnm_disassoc_imminent" so that the old method can be removed.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Refresh of kicking algorithm to minimise messages and streamline some code.
Removed decide_function() which made some logic hard to follow.
Removed kick_client() function to streamline code.
Revised kicking algorithm code to give better user messages.
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
Bug that was preventing kicking working due to mishandling of bandwidth
discovery. Fixed bug in use of get_bandwidth_iwinfo() in AP kicking.
Fix rounding of transmission rate calculations in
get_bandwidth_iwinfo().
Restructure of get_bandwidth...() while finding bug.
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
Bug that could proably cause ineffciency or confusion in multi-SSID
environments.
Adjusted erroneus match test in ap_array_insert().
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
General revisions to maintain code (no functional changes intended).
Removed unnecessary linked-list length checks.
Fixed some typos on function names / comments.
Changed how test_storage forces SEGV due to new compiler warnings.
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
Set pointers to NULL after free() to help force out memory handling errors.
Add some extra memory / resource tracking to try and chase out latent
bugs / leaks Fixed a couple of memory traces that were misreporting.
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
Provide multi-priority syslog() based logging to improve user and
developer experience. Add dawnlog_* functions and macros to convert
printf() family and perror() logging to syslog() family. Removed
unnecessary sprintf() for building log strings (embed format directly).
Add local config settings for log level. Add command line parameters for
log level and destination. Set default log level to suppress a lot of
previously noisy messages. Restore some previously removed noisy
messages as DEBUG level in case they help in future. Eliminate DAWN_NO_OUTPUT static code checks which are no longer used.
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
Remove all global buffers and define them locally instead. Further,
use ctx_local as new name to be sure referencing the correct ctx
context. Further, free buffer after using it.
This adds a few options to use the signal strength as a metric, band
dependent:
- rssi_weight: every db of signal increases the score by this much.
- rssi_center: if the signal is stronger than this, the score becomes
positive; below this, it is negative.
- initial_score: since we are capping negative scores, it may be
beneficial to have a positive base score to offset a possible
negative signal value. This is replacing the 'freq' metric.
To avoid a single-digit RSSI increase resulting in a kick, we add a
global threshold value to act as a buffer:
- kicking_threshold: a candidate AP must have a score larger than that
of the current AP plus the value here.
The kicking_threshold also applies when assembling the list of roaming
neighbors we send with the "wnm_disassoc_imminent" command.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This adds #infndef DAWN_NO_OUTPUT to messages printed to stdout that are
not warnings or errors.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This adds config options to define MACSs of neighbors to be on top of
each band's neighbor list. This is important, because some clients will
limit the number of entries they use. iOS devices, for exmample, use
only the top 6 APs.
The neighbors_11g and neighbors_11a take a list or space-separated
string of AP BSSIDs to keep at the top of each band's neighbor report.
The list is used when the neighbor report is being assembled. Any
listed AP that is not online will not be included in that report. When
the next report is assembled, if the AP is back online, then they are
restored to the indicated order.
There's only one list for each band. In case of multiple SSIDs, you can
include BSSIDs for all of them, and they will be filtered by SSID when
assembling the reports.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This sets the default metric values to the ones currently used in the
openwrt package config file.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This changes the metrics variables that invove scores to arrays. At the
momemnt, there are two bands implemented, 802_11a and 802_11g.
Internally, they are chosen based on the frequency of the channel being
used. Anything < 2500 MHz is 802_11g, and everything else is 802_11a.
Dawn will issue a warning if it finds a frequency greater or equal to
5925 MHz. The upper limit of the 802.11a band, and the start of the
next band vary by country, so this will have to be reviewed.
The UCI configuration changes. Instead of a single metric config, there
will be a global metric config, and one for each band. The
non-band-specific configuration will only work in the global config.
Any per-band configuration present at the global config will be applied
to all bands. Any configuration present at the specific band will
override any global values.
The following configuration options are split into bands:
- ap_weight
- ht_support
- vht_support
- no_ht_support
- no_vht_support
- rssi
- rssi_val
- low_rssi
- low_rssi_val
- freq
- chan_util
- max_chan_util
- chan_util_val
- max_chan_util_val
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This adds a verion field to the ubus configuration message, to avoid
acting upon a message from an incompatible version of dawn.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
The wnm_disassoc_imminent procedure takes a list of neighbor reports to
send to the client.
Instead of picking just one AP to be sent, send all that have the same
score.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This changes the op_class, channel, and SSID fields used to send a
beacon request. Op_class and channel were set from the UCI config file,
but they are dependent on the band being used--they define the frequency
used. The values can be taken from the AP's own neighbor report.
The SSID was set with a blank string, which would return beacons from
any SSID. Since we only care about our own SSID, there's no need to
waste resorces with reports from other SSIDs.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This renames "mode" to "rrm_mode", and its type from int to string.
This way, we can set the correct mode for a probe request from the STA
reported capabilities, along with the preferred order of modes, set by
the "rrm_mode" uci config.
rrm_mode is a string of possible mode letters:
'p' = passive report
'a' = active report
'b' or 't' = beacon table report.
Setting rrm_mode='pat', will try to send passive reports, if available;
if not, it will try an active report, using a beacon table if all else
fails.
If you don't include a letter, the corresponding report type will be
disabled. An empty string will disable beacon reports. Unrecognized
letters are ignored, as well as repeated modes. If the configuration is
not present, a default value of 'pat' will be used.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
dump_rrm_table was called from dump_client with the pointer to the table
data, not the table itself.
Since only the first byte is needed, it can be fetched right away
without looping through the table values, so we can just call
dump_rrm_data passing the table data pointer.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>