Bandsteering: Don't delete just-logged associate requests.
After a successful associate on 5 GHz, we reset the bandsteering state
in the 2.4 GHz associate request. But this currently incorrectly
includes deleting the just-logged associate request, which causes
confusing prints ("Rejecting <MAC> until 0 sec 0 usec") and also may
extend the ten-second rejection window.
This change moves the reset code _before_ the code which logs the
current associate request.
Also, update the "Rejecting..." log message to combine sec and usec
into a single value.
BUG=33493103
Change-Id: Id93128d3f2dadce5e7661c059231c08e5f0671df
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index beb8770..924fc7b 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -1704,6 +1704,20 @@
return;
}
+ if (steering_timestamp_path) {
+ /* If the STA has successfully associated on the bandsteering target
+ * interface, reset the bandsteering state so that we try to bandsteer it
+ * again.
+ */
+ if (read_timestamp_file(mgmt->sa, LOG_ASSOC_SUCCESSFUL, STEERING_PATH, NULL)) {
+ wpa_printf(MSG_INFO, "Resetting bandsteering state for " MACSTR " due to "
+ "successful 5 GHz association",
+ MAC2STR(mgmt->sa));
+ delete_timestamp_file(mgmt->sa, LOG_ASSOC_SUCCESSFUL, STEERING_PATH);
+ delete_timestamp_file(mgmt->sa, LOG_ASSOC, LOGGING_PATH);
+ }
+ }
+
if (request_logging_path) {
maybe_write_timestamp_file(mgmt->sa, hapd, LOG_ASSOC);
}
@@ -1760,23 +1774,12 @@
sta = ap_get_sta(hapd, mgmt->sa);
if (steering_timestamp_path) {
- /* If the STA has successfully associated on the bandsteering target
- * interface, reset the bandsteering state so that we try to bandsteer it
- * again.
- */
- if (read_timestamp_file(mgmt->sa, LOG_ASSOC_SUCCESSFUL, STEERING_PATH, NULL)) {
- wpa_printf(MSG_INFO, "Resetting bandsteering state for " MACSTR,
- MAC2STR(mgmt->sa));
- delete_timestamp_file(mgmt->sa, LOG_ASSOC_SUCCESSFUL, STEERING_PATH);
- delete_timestamp_file(mgmt->sa, LOG_ASSOC, LOGGING_PATH);
- }
-
os_get_reltime(&now);
if (read_timestamp_file(mgmt->sa, LOG_PROBE, STEERING_PATH, &probe_time)) {
if (!read_timestamp_file(mgmt->sa, LOG_ASSOC, LOGGING_PATH,
&bandsteer_until) ||
os_reltime_before(&now, &bandsteer_until)) {
- wpa_printf(MSG_INFO, "Rejecting " MACSTR " until %d sec %d usec",
+ wpa_printf(MSG_INFO, "Rejecting " MACSTR " until %d.%06d usec",
MAC2STR(mgmt->sa), bandsteer_until.sec,
bandsteer_until.usec);
resp = WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY;