]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Override ieee80211w from pmf for AP mode in wpa_supplicant
authorChaoli Zhou <quic_zchaoli@quicinc.com>
Thu, 8 Sep 2022 09:43:32 +0000 (17:43 +0800)
committerJouni Malinen <j@w1.fi>
Mon, 10 Oct 2022 09:30:30 +0000 (12:30 +0300)
Since NetworkManager doesn't support setting ieee80211w to
wpa_supplicant and only support pmf, so override ieee80211w from pmf for
AP mode if ieee80211w not configurated. Do not change behavior for the
P2P GO cases.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
wpa_supplicant/ap.c

index 67f2d8ac143d3d6e20b6010adeddc7b91d069c26..653f15f54d4ef5761ee4069f268bed8b919a69ab 100644 (file)
@@ -704,8 +704,12 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
                bss->wpa_group_rekey = 86400;
        }
 
-       if (ssid->ieee80211w != MGMT_FRAME_PROTECTION_DEFAULT)
+       if (ssid->ieee80211w != MGMT_FRAME_PROTECTION_DEFAULT) {
                bss->ieee80211w = ssid->ieee80211w;
+       } else if (wpa_s->conf->pmf != MGMT_FRAME_PROTECTION_DEFAULT) {
+               if (ssid->mode == WPAS_MODE_AP)
+                       bss->ieee80211w = wpa_s->conf->pmf;
+       }
 
 #ifdef CONFIG_OCV
        bss->ocv = ssid->ocv;