Skip to content

wifi: cfg80211: say why the auth/assoc BSS lookup failed

Louis Kotze linux-wireless lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesNew
  2. v22 patches 2 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2wifi: cfg80211: say why the auth/assoc BSS lookup failedinclude/net/cfg80211.h net/wireless/nl80211.c net/wireless/scan.c +1 more+59 -210 replies
2/2wifi: cfg80211: tests: check BSS lookup failure reasonsnet/wireless/tests/scan.c+119 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] wifi: cfg80211: say why the auth/assoc BSS lookup failed

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

Signature · 1 line
2.55.0