Added WLAN_STA_MFP flag for driver wrappers so that they can configure the
authorJouni Malinen <j@w1.fi>
Tue, 17 Jun 2008 08:21:11 +0000 (11:21 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 17 Jun 2008 08:21:11 +0000 (11:21 +0300)
driver to enable MFP (IEEE 802.11w) processing for the STA.

hostapd/ap.h
hostapd/hostapd.c
hostapd/ieee802_11.c
hostapd/wpa.h
hostapd/wpa_auth_ie.c

index b73c5b4..383ecaf 100644 (file)
@@ -26,6 +26,7 @@
 #define WLAN_STA_SHORT_PREAMBLE BIT(7)
 #define WLAN_STA_PREAUTH BIT(8)
 #define WLAN_STA_WME BIT(9)
+#define WLAN_STA_MFP BIT(10)
 #define WLAN_STA_NONERP BIT(31)
 
 /* Maximum number of supported rates (from both Supported Rates and Extended
index e8d8460..6316054 100644 (file)
@@ -398,7 +398,7 @@ static void hostapd_dump_state(struct hostapd_data *hapd)
                fprintf(f, "\nSTA=" MACSTR "\n", MAC2STR(sta->addr));
 
                fprintf(f,
-                       "  AID=%d flags=0x%x %s%s%s%s%s%s%s%s%s%s\n"
+                       "  AID=%d flags=0x%x %s%s%s%s%s%s%s%s%s%s%s%s\n"
                        "  capability=0x%x listen_interval=%d\n",
                        sta->aid,
                        sta->flags,
@@ -414,6 +414,8 @@ static void hostapd_dump_state(struct hostapd_data *hapd)
                        (sta->flags & WLAN_STA_SHORT_PREAMBLE ?
                         "[SHORT_PREAMBLE]" : ""),
                        (sta->flags & WLAN_STA_PREAUTH ? "[PREAUTH]" : ""),
+                       (sta->flags & WLAN_STA_WME ? "[WME]" : ""),
+                       (sta->flags & WLAN_STA_MFP ? "[MFP]" : ""),
                        (sta->flags & WLAN_STA_NONERP ? "[NonERP]" : ""),
                        sta->capability,
                        sta->listen_interval);
index 388b19d..1ebf985 100644 (file)
@@ -996,6 +996,12 @@ static void handle_assoc(struct hostapd_data *hapd,
                        resp = WLAN_STATUS_INVALID_IE;
                if (resp != WLAN_STATUS_SUCCESS)
                        goto fail;
+#ifdef CONFIG_IEEE80211W
+               if (wpa_auth_uses_mfp(sta->wpa_sm))
+                       sta->flags |= WLAN_STA_MFP;
+               else
+                       sta->flags &= ~WLAN_STA_MFP;
+#endif /* CONFIG_IEEE80211W */
 
 #ifdef CONFIG_IEEE80211R
                if (sta->auth_alg == WLAN_AUTH_FT) {
index cec37fe..5778bb1 100644 (file)
@@ -219,6 +219,7 @@ int wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth,
                        struct wpa_state_machine *sm,
                        const u8 *wpa_ie, size_t wpa_ie_len,
                        const u8 *mdie, size_t mdie_len);
+int wpa_auth_uses_mfp(struct wpa_state_machine *sm);
 struct wpa_state_machine *
 wpa_auth_sta_init(struct wpa_authenticator *wpa_auth, const u8 *addr);
 void wpa_auth_sta_associated(struct wpa_authenticator *wpa_auth,
index 3e011b2..1d2caa3 100644 (file)
@@ -783,3 +783,9 @@ int wpa_parse_kde_ies(const u8 *buf, size_t len, struct wpa_eapol_ie_parse *ie)
 
        return ret;
 }
+
+
+int wpa_auth_uses_mfp(struct wpa_state_machine *sm)
+{
+       return sm ? sm->mgmt_frame_prot : 0;
+}