All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: mac80211: remove/avoid misleading prints
@ 2022-09-15 19:55 James Prestwood
  2022-09-16  5:44 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: James Prestwood @ 2022-09-15 19:55 UTC (permalink / raw)
  To: linux-wireless; +Cc: James Prestwood

At some point a few kernel debug prints started appearing which
indicated something was sending invalid IEs:

"bad VHT capabilities, disabling VHT"
"Invalid HE elem, Disable HE"

Turns out these were being printed because the local hardware
supported HE/VHT but the peer/AP did not. Bad/invalid indicates,
to me at least, that the IE is in some way malformed, not missing.

For the HE print (ieee80211_verify_peer_he_mcs_support) it will
now silently fail if the HE capability element is missing (still
prints if the element size is wrong).

For the VHT print, it has been removed completely and will silently
set the DISABLE_VHT flag which is consistent with how DISABLE_HT
is set.

Signed-off-by: James Prestwood <prestwoj@gmail.com>
---
 net/mac80211/mlme.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index ff449e0c2e62..97cd70b8784b 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -4410,8 +4410,11 @@ ieee80211_verify_peer_he_mcs_support(struct ieee80211_sub_if_data *sdata,
 	he_cap_elem = cfg80211_find_ext_elem(WLAN_EID_EXT_HE_CAPABILITY,
 					     ies->data, ies->len);
 
+	if (!he_cap_elem)
+		return false;
+
 	/* invalid HE IE */
-	if (!he_cap_elem || he_cap_elem->datalen < 1 + sizeof(*he_cap)) {
+	if (he_cap_elem->datalen < 1 + sizeof(*he_cap)) {
 		sdata_info(sdata,
 			   "Invalid HE elem, Disable HE\n");
 		return false;
@@ -4677,8 +4680,6 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
 		}
 
 		if (!elems->vht_cap_elem) {
-			sdata_info(sdata,
-				   "bad VHT capabilities, disabling VHT\n");
 			*conn_flags |= IEEE80211_CONN_DISABLE_VHT;
 			vht_oper = NULL;
 		}
-- 
2.34.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: mac80211: remove/avoid misleading prints
  2022-09-15 19:55 [PATCH] net: mac80211: remove/avoid misleading prints James Prestwood
@ 2022-09-16  5:44 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2022-09-16  5:44 UTC (permalink / raw)
  To: James Prestwood; +Cc: linux-wireless

James Prestwood <prestwoj@gmail.com> writes:

> At some point a few kernel debug prints started appearing which
> indicated something was sending invalid IEs:
>
> "bad VHT capabilities, disabling VHT"
> "Invalid HE elem, Disable HE"
>
> Turns out these were being printed because the local hardware
> supported HE/VHT but the peer/AP did not. Bad/invalid indicates,
> to me at least, that the IE is in some way malformed, not missing.
>
> For the HE print (ieee80211_verify_peer_he_mcs_support) it will
> now silently fail if the HE capability element is missing (still
> prints if the element size is wrong).
>
> For the VHT print, it has been removed completely and will silently
> set the DISABLE_VHT flag which is consistent with how DISABLE_HT
> is set.
>
> Signed-off-by: James Prestwood <prestwoj@gmail.com>

This has been cluttering my test logs as well, thanks for fixing this.
But the title should be:

wifi: mac80211: remove/avoid misleading prints

I assume Johannes can fix it during commit.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-16  5:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 19:55 [PATCH] net: mac80211: remove/avoid misleading prints James Prestwood
2022-09-16  5:44 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.