AP: Cleanup coding style for deauth/disassoc handling
Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
parent
62fcfe8d28
commit
ced69780c1
1 changed files with 16 additions and 14 deletions
|
@ -5511,8 +5511,8 @@ static void hostapd_deauth_sta(struct hostapd_data *hapd,
|
||||||
struct sta_info *sta,
|
struct sta_info *sta,
|
||||||
const struct ieee80211_mgmt *mgmt)
|
const struct ieee80211_mgmt *mgmt)
|
||||||
{
|
{
|
||||||
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "deauthentication: STA=" MACSTR
|
wpa_msg(hapd->msg_ctx, MSG_DEBUG,
|
||||||
" reason_code=%d",
|
"deauthentication: STA=" MACSTR " reason_code=%d",
|
||||||
MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code));
|
MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code));
|
||||||
|
|
||||||
ap_sta_set_authorized(hapd, sta, 0);
|
ap_sta_set_authorized(hapd, sta, 0);
|
||||||
|
@ -5535,9 +5535,9 @@ static void hostapd_disassoc_sta(struct hostapd_data *hapd,
|
||||||
struct sta_info *sta,
|
struct sta_info *sta,
|
||||||
const struct ieee80211_mgmt *mgmt)
|
const struct ieee80211_mgmt *mgmt)
|
||||||
{
|
{
|
||||||
wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d",
|
wpa_msg(hapd->msg_ctx, MSG_DEBUG,
|
||||||
MAC2STR(mgmt->sa),
|
"disassocation: STA=" MACSTR " reason_code=%d",
|
||||||
le_to_host16(mgmt->u.disassoc.reason_code));
|
MAC2STR(mgmt->sa), le_to_host16(mgmt->u.disassoc.reason_code));
|
||||||
|
|
||||||
ap_sta_set_authorized(hapd, sta, 0);
|
ap_sta_set_authorized(hapd, sta, 0);
|
||||||
sta->last_seq_ctrl = WLAN_INVALID_MGMT_SEQ;
|
sta->last_seq_ctrl = WLAN_INVALID_MGMT_SEQ;
|
||||||
|
@ -5588,16 +5588,17 @@ static void handle_disassoc(struct hostapd_data *hapd,
|
||||||
struct sta_info *sta;
|
struct sta_info *sta;
|
||||||
|
|
||||||
if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.disassoc)) {
|
if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.disassoc)) {
|
||||||
wpa_printf(MSG_INFO,
|
wpa_msg(hapd->msg_ctx, MSG_DEBUG,
|
||||||
"handle_disassoc - too short payload (len=%lu)",
|
"handle_disassoc - too short payload (len=%lu)",
|
||||||
(unsigned long) len);
|
(unsigned long) len);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sta = ap_get_sta(hapd, mgmt->sa);
|
sta = ap_get_sta(hapd, mgmt->sa);
|
||||||
if (sta == NULL) {
|
if (!sta) {
|
||||||
wpa_printf(MSG_INFO, "Station " MACSTR " trying to disassociate, but it is not associated",
|
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR
|
||||||
MAC2STR(mgmt->sa));
|
" trying to disassociate, but it is not associated",
|
||||||
|
MAC2STR(mgmt->sa));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5611,8 +5612,9 @@ static void handle_deauth(struct hostapd_data *hapd,
|
||||||
struct sta_info *sta;
|
struct sta_info *sta;
|
||||||
|
|
||||||
if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.deauth)) {
|
if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.deauth)) {
|
||||||
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "handle_deauth - too short "
|
wpa_msg(hapd->msg_ctx, MSG_DEBUG,
|
||||||
"payload (len=%lu)", (unsigned long) len);
|
"handle_deauth - too short payload (len=%lu)",
|
||||||
|
(unsigned long) len);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5620,9 +5622,9 @@ static void handle_deauth(struct hostapd_data *hapd,
|
||||||
ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE);
|
ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE);
|
||||||
|
|
||||||
sta = ap_get_sta(hapd, mgmt->sa);
|
sta = ap_get_sta(hapd, mgmt->sa);
|
||||||
if (sta == NULL) {
|
if (!sta) {
|
||||||
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
|
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR
|
||||||
"to deauthenticate, but it is not authenticated",
|
" trying to deauthenticate, but it is not authenticated",
|
||||||
MAC2STR(mgmt->sa));
|
MAC2STR(mgmt->sa));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue