@@ -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);
@@ -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);