From ce018048723344fe6926301a088dfbbc0f0d4461 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 3 Jan 2020 13:50:35 +0200 Subject: [PATCH] Convert the only remaining send_frame() users to send_mlme() Since send_mlme() now has support for the no_encrypt argument it is possible to get rid of the remaining send_frame() uses. Signed-off-by: Jouni Malinen --- src/ap/ctrl_iface_ap.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c index 335d5a7b1..a54b0ca2c 100644 --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c @@ -526,8 +526,7 @@ int hostapd_ctrl_iface_deauthenticate(struct hostapd_data *hapd, if (pos) { struct ieee80211_mgmt mgmt; int encrypt; - if (!hapd->drv_priv || !hapd->driver->send_frame) - return -1; + pos += 6; encrypt = atoi(pos); os_memset(&mgmt, 0, sizeof(mgmt)); @@ -537,10 +536,10 @@ int hostapd_ctrl_iface_deauthenticate(struct hostapd_data *hapd, os_memcpy(mgmt.sa, hapd->own_addr, ETH_ALEN); os_memcpy(mgmt.bssid, hapd->own_addr, ETH_ALEN); mgmt.u.deauth.reason_code = host_to_le16(reason); - if (hapd->driver->send_frame(hapd->drv_priv, (u8 *) &mgmt, - IEEE80211_HDRLEN + - sizeof(mgmt.u.deauth), - encrypt) < 0) + if (hostapd_drv_send_mlme(hapd, (u8 *) &mgmt, + IEEE80211_HDRLEN + + sizeof(mgmt.u.deauth), + 0, NULL, 0, !encrypt) < 0) return -1; return 0; } @@ -589,8 +588,7 @@ int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd, if (pos) { struct ieee80211_mgmt mgmt; int encrypt; - if (!hapd->drv_priv || !hapd->driver->send_frame) - return -1; + pos += 6; encrypt = atoi(pos); os_memset(&mgmt, 0, sizeof(mgmt)); @@ -600,10 +598,10 @@ int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd, os_memcpy(mgmt.sa, hapd->own_addr, ETH_ALEN); os_memcpy(mgmt.bssid, hapd->own_addr, ETH_ALEN); mgmt.u.disassoc.reason_code = host_to_le16(reason); - if (hapd->driver->send_frame(hapd->drv_priv, (u8 *) &mgmt, - IEEE80211_HDRLEN + - sizeof(mgmt.u.deauth), - encrypt) < 0) + if (hostapd_drv_send_mlme(hapd, (u8 *) &mgmt, + IEEE80211_HDRLEN + + sizeof(mgmt.u.deauth), + 0, NULL, 0, !encrypt) < 0) return -1; return 0; }