Re: [PATCH v2 1/2] wifi: cfg80211: say why the auth/assoc BSS lookup failed

From: Louis Kotze

Date: Wed Jul 22 2026 - 03:08:46 EST


On Wed, 2026-07-22 at 00:10 +0200, Johannes Berg wrote:
> > + if (!attrs[NL80211_ATTR_MAC] || !attrs[NL80211_ATTR_WIPHY_FREQ]) {
> > + NL_SET_ERR_MSG(info->extack, "BSSID or frequency missing");
>
> could use the GENL versions and save some characters :)

Done in v3.

> > - NL_SET_ERR_MSG_ATTR(info->extack, link,
> > - "Error fetching BSS for link");
> > + NL_SET_BAD_ATTR(info->extack, link);
>
> why remove the message, it's possible to have both?

There still is a message here: __cfg80211_get_bss() has already set
the specific one by the time this runs, and NL_SET_ERR_MSG_ATTR()
would overwrite it with the generic text again. Added a comment in
v3 to make that visible.

> > - req.bss = nl80211_assoc_bss(rdev, ssid, ssid_len, info->attrs,
> > - -1, -1);
> > + req.bss = nl80211_assoc_bss(rdev, info, ssid, ssid_len,
> > + info->attrs, -1, -1);
>
> entirely unrelated (whitespace) change?

The call gains the new "info" argument; v3 keeps the original
wrapping so only that shows in the diff.

> That code should probably have a comment that the is_bss() must come
> first...

Added.

> Also however, it could result in having *both* 'unusable' and
> 'expired' set, and then
> [...]
> you prefer the 'unusable' message... not sure that makes sense?

Right. v3 sets a combined message when matching entries were rejected
for different reasons, so neither is preferred or hidden.

> I also don't think the "scan again" instruction makes any sense here -
> this is meant to provide an error message, not instructions how to fix
> it?

Dropped, the messages are purely descriptive now.

Sending v3 shortly.

thanks,
Louis