From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v2 05/13] blacklist: add BLACKLIST_REASON_TRANSIENT_ERROR
Date: Mon, 24 Mar 2025 07:15:30 -0700 [thread overview]
Message-ID: <20250324141538.144578-6-prestwoj@gmail.com> (raw)
In-Reply-To: <20250324141538.144578-1-prestwoj@gmail.com>
This is meant to replace the blacklist held in network objects,
known as the temporary blacklist. For these entires there is no
expiration as it will be up to network.c to remove them as it does
now internally.
---
src/blacklist.c | 13 +++++++++++++
src/blacklist.h | 12 ++++++++++++
2 files changed, 25 insertions(+)
diff --git a/src/blacklist.c b/src/blacklist.c
index ca699767..17122840 100644
--- a/src/blacklist.c
+++ b/src/blacklist.c
@@ -76,6 +76,16 @@ static struct blacklist_entry *blacklist_entry_new(const uint8_t *addr,
added = l_time_now();
expires = l_time_offset(added, blacklist_initial_timeout);
break;
+ case BLACKLIST_REASON_TRANSIENT_ERROR:
+ /*
+ * The temporary blacklist is a special case where entries are
+ * required to be removed manually. This type of blacklist is
+ * only used for an ongoing connection attempt to iterate BSS's
+ * and not retry until all have been exhausted.
+ */
+ added = 0;
+ expires = 0;
+ break;
default:
l_warn("Unhandled blacklist reason: %u", reason);
return NULL;
@@ -96,6 +106,9 @@ static bool check_if_expired(void *data, void *user_data)
struct blacklist_entry *entry = data;
uint64_t now = l_get_u64(user_data);
+ if (entry->reason == BLACKLIST_REASON_TRANSIENT_ERROR)
+ return false;
+
if (l_time_after(now, entry->expire_time)) {
l_debug("Removing entry "MAC" on prune", MAC_STR(entry->addr));
l_free(entry);
diff --git a/src/blacklist.h b/src/blacklist.h
index a87e5eca..dc7891d1 100644
--- a/src/blacklist.h
+++ b/src/blacklist.h
@@ -26,6 +26,18 @@ enum blacklist_reason {
* connect to it via autoconnect
*/
BLACKLIST_REASON_CONNECT_FAILED,
+ /*
+ * Used to blacklist a BSS under certain failure conditions that don't
+ * warrant a full ban from connecting. This can include an invalid
+ * password, or an auth/assoc failure with a subset of status codes that
+ * indicate the BSS is overloaded or cannot accept new connections.
+ *
+ * This is used to mark the last BSS as having failed, and to continue
+ * iterating BSS's. Once the list has been exhausted or a connection has
+ * succeeded all blacklist entries with this reason code should be
+ * cleared.
+ */
+ BLACKLIST_REASON_TRANSIENT_ERROR,
};
void blacklist_add_bss(const uint8_t *addr, enum blacklist_reason reason);
--
2.34.1
next prev parent reply other threads:[~2025-03-24 14:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 14:15 [PATCH v2 00/13] Roam blacklisting and scan BSS groups James Prestwood
2025-03-24 14:15 ` [PATCH v2 01/13] station: always network (temp) blacklist on failure James Prestwood
2025-03-24 14:15 ` [PATCH v2 02/13] auto-t: add test for disabling the timeout blacklist James Prestwood
2025-03-24 14:15 ` [PATCH v2 03/13] blacklist: include a blacklist reason when adding/finding James Prestwood
2025-03-24 14:15 ` [PATCH v2 04/13] blacklist: fix pruning to remove the entry if its expired James Prestwood
2025-03-24 14:15 ` James Prestwood [this message]
2025-03-24 14:15 ` [PATCH v2 06/13] network: update to use blacklist's new temporary type James Prestwood
2025-03-24 14:15 ` [PATCH v2 07/13] blacklist: add new blacklist reason, ROAM_REQUESTED James Prestwood
2025-03-24 14:15 ` [PATCH v2 08/13] scan: Introduce higher level scan BSS groups James Prestwood
2025-03-24 14:15 ` [PATCH v2 09/13] station: roam blacklist BSS when a roam is requested James Prestwood
2025-03-24 14:15 ` [PATCH v2 10/13] station: roam blacklist AP even mid-roam James Prestwood
2025-03-24 14:15 ` [PATCH v2 11/13] station: adapt roam scan logic to look at the bss group James Prestwood
2025-03-24 14:15 ` [PATCH v2 12/13] auto-t: add tests for AP roam blacklisting James Prestwood
2025-03-24 14:15 ` [PATCH v2 13/13] doc: document OptimalSignalThreshold and InitialRoamRequestedTimeout James Prestwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250324141538.144578-6-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox