P2P MGMT/ACTION

Marek.Kwaczynski at tieto.com Marek.Kwaczynski
Tue May 17 03:20:35 PDT 2011


Hi all,

Isn't it a bit weird that in spite of an interface to send MGMT/ACTION (mgmt_tx) frames the supplicant is using the monitor interface to send Action Frame in case of AP mode? 
What do tou think about it?

In source code:

static int wpa_driver_nl80211_send_mlme(void *priv, const u8 *data,
size_t data_len)
{
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
struct ieee80211_mgmt *mgmt;
int encrypt = 1;
u16 fc;
drv->nlmode == 3 (NL80211_IFTYPE_AP)
mgmt = (struct ieee80211_mgmt *) data;
fc = le_to_host16(mgmt->frame_control);
if (drv->nlmode == NL80211_IFTYPE_STATION &&
WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_PROBE_RESP) {
/*
* The use of last_mgmt_freq is a bit of a hack,
* but it works due to the single-threaded nature
* of wpa_supplicant.
*/
wpa_printf(MSG_DEBUG, "nl80211: XMARKWA wpa_driver_nl80211_send_mlme 1, last_mgmy_freq = %d", drv->last_mgmt_freq);
return nl80211_send_frame_cmd(drv, drv->last_mgmt_freq, 0,
data, data_len, NULL);
}
if (WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_AUTH) {
/*
* Only one of the authentication frame types is encrypted.
* In order for static WEP encryption to work properly (i.e.,
* to not encrypt the frame), we need to tell mac80211 about
* the frames that must not be encrypted.
*/
u16 auth_alg = le_to_host16(mgmt->u.auth.auth_alg);
u16 auth_trans = le_to_host16(mgmt->u.auth.auth_transaction);
if (auth_alg != WLAN_AUTH_SHARED_KEY || auth_trans != 3)
encrypt = 0;
}
return wpa_driver_nl80211_send_frame(drv, data, data_len, encrypt); //This function is called for AP mode and then ACTION frame is sent by te monitor interface
}

Best regards,
Marek



More information about the Hostap mailing list