Rename function `ubus_add_oject` -> `ubus_add_dawn_object` to avoid
confusion and potential collision with function `add_ubus_object` from
libubus.
Signed-off-by: Martin Matějek <martin.matejek@gmx.com>
This also fix a typo error on check_timeout on wrong list
Fixes: 47e98ef ("network: ping pong keepalive for tcp connections")
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
For an unknown reason the entry that is returned in ap_array_unlink_entry
was always set to NULL. This commit changes the function so it returns the
ap that should be unlinked. This is needed to free the corresponding
memory that is allocated by the ap struct.
Thanks a lot to ptpt52 for reporting this issue.
Signed-off-by: Nick Hainke <vincent@systemli.org>
To make the tcp connections keepalive and better handle the timeout
of connections
con_timeout indicate the connection timeout and it is configurable
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Somtimes client connetions will not close therfore add a timeout. Add a
new timer that checks every 5s if we did not receive anything from a
client for (default) 60s. Can be configured via client_timeout.
Code is based on the work of ptpt52.
Signed-off-by: Nick Hainke <vincent@systemli.org>
The preferred neighbors list may have BSSIDs with different SSIDs. Add
only those that match the interface's SSID.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
In the build_hearing_map_sort_client there was a dawn_mutex_require
without having locked the mutex resulting in warnings:
daemon.warn dawn: MUTEX require = 4226B8@ubus.c:2003[2012069248l] - appears to be UNLOCKED!
daemon.warn dawn: MUTEX require = 4226B8@datastorage.c:694[2012069248l] - appears to be UNLOCKED!
I guess it was a typo, because before entering the
client_array_get_client function the mutex client_array_mutex needs to
be locked and not required.
Signed-off-by: Nick Hainke <vincent@systemli.org>
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>