]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Add a separate driver capability for control port RX
authorJouni Malinen <j@w1.fi>
Sun, 19 Apr 2020 09:30:55 +0000 (12:30 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 19 Apr 2020 12:53:02 +0000 (15:53 +0300)
This is needed since the initial implementation of the control port
mechanism in the kernel mixed in RSN pre-authentication ethertype
unconditionally (and IMHO, incorrectly) into the control port.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/drivers/driver.h
src/drivers/driver_common.c
src/drivers/driver_nl80211.c
src/drivers/driver_nl80211_capa.c

index e01f26c1223ef10f58d516b47cb9a5b44366ba08..019a1081ea71616f964ca9011d7482ab9dcc47c7 100644 (file)
@@ -1838,7 +1838,7 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_FTM_RESPONDER         0x0100000000000000ULL
 /** Driver support 4-way handshake offload for WPA-Personal */
 #define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK    0x0200000000000000ULL
-/** Driver supports a separate control port for EAPOL frames */
+/** Driver supports a separate control port TX for EAPOL frames */
 #define WPA_DRIVER_FLAGS_CONTROL_PORT          0x0400000000000000ULL
 /** Driver supports VLAN offload */
 #define WPA_DRIVER_FLAGS_VLAN_OFFLOAD          0x0800000000000000ULL
@@ -1852,6 +1852,8 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID       0x8000000000000000ULL
        u64 flags;
 
+/** Driver supports a separate control port RX for EAPOL frames */
+#define WPA_DRIVER_FLAGS2_CONTROL_PORT_RX      0x0000000000000001ULL
        u64 flags2;
 
 #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
index c62cf51e3c3e3f17562da6b03b9617bdd541185f..23a6a42931020c4668a44672d841d784a646647b 100644 (file)
@@ -327,6 +327,7 @@ const char * driver_flag2_to_string(u64 flag2)
 {
 #define DF2S(x) case WPA_DRIVER_FLAGS2_ ## x: return #x
        switch (flag2) {
+       DF2S(CONTROL_PORT_RX);
        }
        return "UNKNOWN";
 #undef DF2S
index 21f5000b056addec50c7ebf1d13a5f5b04290656..3364054f8fe0bd5232468fd61d376c6f58a73cb8 100644 (file)
@@ -8124,8 +8124,10 @@ static int nl80211_set_param(void *priv, const char *param)
                drv->test_use_roc_tx = 1;
        }
 
-       if (os_strstr(param, "control_port=0"))
+       if (os_strstr(param, "control_port=0")) {
                drv->capa.flags &= ~WPA_DRIVER_FLAGS_CONTROL_PORT;
+               drv->capa.flags2 &= ~WPA_DRIVER_FLAGS2_CONTROL_PORT_RX;
+       }
 
        if (os_strstr(param, "full_ap_client_state=0"))
                drv->capa.flags &= ~WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE;
index b4fed9ea8a37afa67e5ff67dd95f060eee8d3acd..f0335912c7748e3606e04ba436f4c06f34a72904 100644 (file)
@@ -441,6 +441,9 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info,
        if (ext_feature_isset(ext_features, len,
                              NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211))
                capa->flags |= WPA_DRIVER_FLAGS_CONTROL_PORT;
+       if (ext_feature_isset(ext_features, len,
+                             NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH))
+               capa->flags2 |= WPA_DRIVER_FLAGS2_CONTROL_PORT_RX;
 
        if (ext_feature_isset(ext_features, len,
                              NL80211_EXT_FEATURE_VLAN_OFFLOAD))