[PATCH v2 01/11] nl80211: also check for no preauth feature

Markus Theil <[email protected]>
Newsgroups gmane.linux.drivers.hostap
Message-ID <[email protected]>
Before Linux 5.7 all pre-auth frames are forwared over the nl80211 ctrl
port, if it is registered. hostap and wpa_supplicant currently do not assume
this behavior, as pre-auth frames should be handled as ordinary data frames
in the kernel. Checking against the NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH
feature flag allows us to disable this behavior later on ctrl port registration.

No new capa->flags value is introduced, instead WPA_DRIVER_FLAGS_CONTROL_PORT is
only set now, if this feature is present. Without this feature, only control
port tx is possible without breaking pre-auth features.

Signed-off-by: Markus Theil <[email protected]>
---
 src/drivers/driver_nl80211_capa.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index b4fed9ea8..cd0ecf75d 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -439,7 +439,9 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info,
 		capa->flags |= WPA_DRIVER_FLAGS_FTM_RESPONDER;
 
 	if (ext_feature_isset(ext_features, len,
-			      NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211))
+			      NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211) &&
+	    ext_feature_isset(ext_features, len,
+			      NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH))
 		capa->flags |= WPA_DRIVER_FLAGS_CONTROL_PORT;
 
 	if (ext_feature_isset(ext_features, len,
-- 
2.26.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.