Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369405
b: refs/heads/master
c: 79ba1d8
h: refs/heads/master
i:
  369403: 1b8e549
v: v3
  • Loading branch information
Johannes Berg committed Apr 8, 2013
1 parent 5ca7afe commit 9819bf8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1946bed95707ef75d85e94ebe106ce7a119ca831
refs/heads/master: 79ba1d8910f517c3bd39d794ddb1a5b4c03795c4
10 changes: 10 additions & 0 deletions trunk/include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1955,6 +1955,16 @@ enum ieee80211_timeout_interval_type {
WLAN_TIMEOUT_ASSOC_COMEBACK = 3 /* 802.11w */,
};

/**
* struct ieee80211_timeout_interval_ie - Timeout Interval element
* @type: type, see &enum ieee80211_timeout_interval_type
* @value: timeout interval value
*/
struct ieee80211_timeout_interval_ie {
u8 type;
__le32 value;
} __packed;

/* BACK action code */
enum ieee80211_back_actioncode {
WLAN_ACTION_ADDBA_REQ = 0,
Expand Down
3 changes: 1 addition & 2 deletions trunk/net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ struct ieee802_11_elems {
const struct ieee80211_channel_sw_ie *ch_switch_ie;
const u8 *country_elem;
const u8 *pwr_constr_elem;
const u8 *timeout_int;
const struct ieee80211_timeout_interval_ie *timeout_int;
const u8 *opmode_notif;

/* length of them, respectively */
Expand All @@ -1198,7 +1198,6 @@ struct ieee802_11_elems {
u8 prep_len;
u8 perr_len;
u8 country_elem_len;
u8 timeout_int_len;

/* whether a parse error occurred while retrieving these elements */
bool parse_error;
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2629,10 +2629,10 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems);

if (status_code == WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY &&
elems.timeout_int && elems.timeout_int_len == 5 &&
elems.timeout_int[0] == WLAN_TIMEOUT_ASSOC_COMEBACK) {
elems.timeout_int &&
elems.timeout_int->type == WLAN_TIMEOUT_ASSOC_COMEBACK) {
u32 tu, ms;
tu = get_unaligned_le32(elems.timeout_int + 1);
tu = le32_to_cpu(elems.timeout_int->value);
ms = tu * 1024 / 1000;
sdata_info(sdata,
"%pM rejected association temporarily; comeback duration %u TU (%u ms)\n",
Expand Down
6 changes: 4 additions & 2 deletions trunk/net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,10 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
elems->pwr_constr_elem = pos;
break;
case WLAN_EID_TIMEOUT_INTERVAL:
elems->timeout_int = pos;
elems->timeout_int_len = elen;
if (elen >= sizeof(struct ieee80211_timeout_interval_ie))
elems->timeout_int = (void *)pos;
else
elem_parse_failed = true;
break;
default:
break;
Expand Down

0 comments on commit 9819bf8

Please sign in to comment.