From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 3/8] blacklist: add BLACKLIST_REASON_TEMPORARY
Date: Mon, 10 Mar 2025 14:40:54 -0700 [thread overview]
Message-ID: <20250310214059.20809-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20250310214059.20809-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 | 7 +++++++
2 files changed, 20 insertions(+)
diff --git a/src/blacklist.c b/src/blacklist.c
index 12100a07..eef3f730 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_TEMPORARY:
+ /*
+ * 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_TEMPORARY)
+ 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 d4da4478..6ce26aba 100644
--- a/src/blacklist.h
+++ b/src/blacklist.h
@@ -26,6 +26,13 @@ enum blacklist_reason {
* connect to it via autoconnect
*/
BLACKLIST_REASON_PERMANENT,
+ /*
+ * When a BSS is blacklisted due to a specific subset of error codes.
+ * This reason is somewhat of a special case and has no expiration. It
+ * is assumed that the calling module will remove these entries when
+ * appropriate (after a connection/disconnection)
+ */
+ BLACKLIST_REASON_TEMPORARY,
};
void blacklist_add_bss(const uint8_t *addr, enum blacklist_reason reason);
--
2.34.1
next prev parent reply other threads:[~2025-03-10 21:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 21:40 [PATCH 1/8] blacklist: include a blacklist reason when adding/finding James Prestwood
2025-03-10 21:40 ` [PATCH 2/8] blacklist: fix pruning to remove the entry if its expired James Prestwood
2025-03-10 21:40 ` James Prestwood [this message]
2025-03-10 21:40 ` [PATCH 4/8] network: update to use blacklist's new temporary type James Prestwood
2025-03-10 21:40 ` [PATCH 5/8] blacklist: add new blacklist reason, ROAM_REQUESTED James Prestwood
2025-03-10 21:40 ` [PATCH 6/8] scan: Introduce higher level scan BSS groups James Prestwood
2025-03-10 21:40 ` [PATCH 7/8] station: roam blacklist BSS when a roam is requested James Prestwood
2025-03-10 21:40 ` [PATCH 8/8] auto-t: add test for AP roam blacklisting 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=20250310214059.20809-3-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