Linux wireless drivers development
 help / color / mirror / Atom feed
From: Louis Kotze <loukot@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	loukot@gmail.com
Subject: [PATCH v3 0/2] wifi: cfg80211: say why the auth/assoc BSS lookup failed
Date: Wed, 22 Jul 2026 09:07:32 +0200	[thread overview]
Message-ID: <20260722070734.3612581-1-loukot@gmail.com> (raw)
In-Reply-To: <bbb15b0ae332d7344f5b69da5e993acc6813aca7.camel@sipsolutions.net>

The BSS lookup for an authentication or association request can fail
because no scan entry exists, because the entry is expired, or because
the entry's use_for flags forbid the requested use. All three
currently produce the same generic (or no) diagnostic, which
wpa_supplicant relays verbatim as the only hint a user gets when e.g.
an MLO association degrades to fewer links.

Patch 1 makes __cfg80211_get_bss() record the reason via an optional
extack while it walks the BSS table, and wires the auth and assoc
paths up to it. Patch 2 adds a KUnit test for the reported reasons.

Still demonstrated end-to-end in a mac80211_hwsim VM: an unpatched
wpa_supplicant failing an MLD reassociation on a stale per-link BSS
now logs "nl80211: kernel reports: BSS not found in scan results"
plus the failing link, instead of the generic message.

v3: address Johannes' review of v2: use GENL_SET_ERR_MSG for the
-EINVAL messages in nl80211_assoc_bss(); comment why the bare
NL_SET_BAD_ATTR is enough there (the lookup already set the specific
message); comment that the identity checks in the walk must precede
the expired/unusable classification; report a combined message when
matching entries were rejected for different reasons instead of
preferring one of them; drop the "scan again" instruction so the
messages are purely descriptive; keep the original argument wrapping
at the nl80211_associate() call site so only the new argument shows
in the diff.

v2: per Johannes' feedback on v1, capture the reason inside
__cfg80211_get_bss() during the single bss_lock walk instead of a
separate re-walk helper; cover the previously silent authentication
path; add the KUnit test.

Louis Kotze (2):
  wifi: cfg80211: say why the auth/assoc BSS lookup failed
  wifi: cfg80211: tests: check BSS lookup failure reasons

 include/net/cfg80211.h    |   7 ++-
 net/wireless/nl80211.c    |  27 +++++----
 net/wireless/scan.c       |  44 +++++++++++---
 net/wireless/tests/scan.c | 121 +++++++++++++++++++++++++++++++++++++-
 4 files changed, 178 insertions(+), 21 deletions(-)


base-commit: 69bd85e933c617a84fa54fcc80e628e98afdc45d
-- 
2.55.0


  parent reply	other threads:[~2026-07-22  7:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-11  4:34 [PATCH] wifi: nl80211: say why the association BSS lookup failed Louis Kotze
2026-07-21 15:31 ` Johannes Berg
2026-07-21 18:11   ` [PATCH v2 0/2] wifi: cfg80211: say why the auth/assoc " Louis Kotze
2026-07-21 18:11     ` [PATCH v2 1/2] " Louis Kotze
2026-07-21 22:10       ` Johannes Berg
2026-07-22  7:07         ` Louis Kotze
2026-07-22  7:07         ` Louis Kotze [this message]
2026-07-22  7:07           ` [PATCH v3 " Louis Kotze
2026-07-22  7:07           ` [PATCH v3 2/2] wifi: cfg80211: tests: check BSS lookup failure reasons Louis Kotze
2026-07-21 18:11     ` [PATCH v2 " Louis Kotze

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=20260722070734.3612581-1-loukot@gmail.com \
    --to=loukot@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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