WNM: Remove unnecessary extra indentation level

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2012-12-16 12:51:02 +02:00
parent 68db9ab047
commit 0a47a6a747

View file

@ -213,21 +213,20 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_supplicant *wpa_s,
"TFS Resp IE"); "TFS Resp IE");
} }
} else if (wnmsleep_ie->action_type == 1) { } else if (wnmsleep_ie->action_type == 1) {
u8 *ptr, *end;
wpa_drv_wnm_oper(wpa_s, WNM_SLEEP_EXIT_CONFIRM, wpa_drv_wnm_oper(wpa_s, WNM_SLEEP_EXIT_CONFIRM,
wpa_s->bssid, NULL, NULL); wpa_s->bssid, NULL, NULL);
/* Install GTK/IGTK */ /* Install GTK/IGTK */
do {
/* point to key data field */ /* point to key data field */
u8 *ptr = (u8 *) frm + 1 + 1 + 2; ptr = (u8 *) frm + 1 + 1 + 2;
u8 *end = ptr + key_len_total; end = ptr + key_len_total;
wpa_hexdump_key(MSG_DEBUG, "WNM: Key Data", wpa_hexdump_key(MSG_DEBUG, "WNM: Key Data",
ptr, key_len_total); ptr, key_len_total);
while (ptr + 1 < end) { while (ptr + 1 < end) {
if (ptr + 2 + ptr[1] > end) { if (ptr + 2 + ptr[1] > end) {
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"WNM: Invalid Key " "WNM: Invalid Key "
"Data element " "Data element length");
"length");
if (end > ptr) if (end > ptr)
wpa_hexdump(MSG_DEBUG, "WNM: Remaining data", ptr, end - ptr); wpa_hexdump(MSG_DEBUG, "WNM: Remaining data", ptr, end - ptr);
break; break;
@ -240,8 +239,7 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_supplicant *wpa_s,
} }
gtk_len = *(ptr + 4); gtk_len = *(ptr + 4);
if (ptr[1] < 11 + gtk_len || if (ptr[1] < 11 + gtk_len ||
gtk_len < 5 || gtk_len > 32) gtk_len < 5 || gtk_len > 32) {
{
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"WNM: Invalid GTK subelem"); "WNM: Invalid GTK subelem");
break; break;
@ -252,10 +250,8 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_supplicant *wpa_s,
ptr); ptr);
ptr += 13 + gtk_len; ptr += 13 + gtk_len;
#ifdef CONFIG_IEEE80211W #ifdef CONFIG_IEEE80211W
} else if (*ptr == } else if (*ptr == WNM_SLEEP_SUBELEM_IGTK) {
WNM_SLEEP_SUBELEM_IGTK) { if (ptr[1] < 2 + 6 + WPA_IGTK_LEN) {
if (ptr[1] < 2 + 6 +
WPA_IGTK_LEN) {
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"WNM: Too short IGTK subelem"); "WNM: Too short IGTK subelem");
break; break;
@ -269,7 +265,6 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_supplicant *wpa_s,
} else } else
break; /* skip the loop */ break; /* skip the loop */
} }
} while(0);
} }
} else { } else {
wpa_printf(MSG_DEBUG, "Reject recv WNM-Sleep Response frame " wpa_printf(MSG_DEBUG, "Reject recv WNM-Sleep Response frame "