Skip to content

Commit a18d4d7

Browse files
Michael-CY LeeSasha Levin
authored andcommitted
wifi: mac80211: fix the type of status_code for negotiated TID to Link Mapping
[ Upstream commit e12a42f ] The status code should be type of __le16. Fixes: 83e897a ("wifi: ieee80211: add definitions for negotiated TID to Link map") Fixes: 8f500fb ("wifi: mac80211: process and save negotiated TID to Link mapping request") Signed-off-by: Michael-CY Lee <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 875b1a4 commit a18d4d7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/linux/ieee80211.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@ struct ieee80211_mgmt {
15241524
struct {
15251525
u8 action_code;
15261526
u8 dialog_token;
1527-
u8 status_code;
1527+
__le16 status_code;
15281528
u8 variable[];
15291529
} __packed ttlm_res;
15301530
struct {

net/mac80211/mlme.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7177,6 +7177,7 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata,
71777177
int hdr_len = offsetofend(struct ieee80211_mgmt, u.action.u.ttlm_res);
71787178
int ttlm_max_len = 2 + 1 + sizeof(struct ieee80211_ttlm_elem) + 1 +
71797179
2 * 2 * IEEE80211_TTLM_NUM_TIDS;
7180+
u16 status_code;
71807181

71817182
skb = dev_alloc_skb(local->tx_headroom + hdr_len + ttlm_max_len);
71827183
if (!skb)
@@ -7199,19 +7200,18 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata,
71997200
WARN_ON(1);
72007201
fallthrough;
72017202
case NEG_TTLM_RES_REJECT:
7202-
mgmt->u.action.u.ttlm_res.status_code =
7203-
WLAN_STATUS_DENIED_TID_TO_LINK_MAPPING;
7203+
status_code = WLAN_STATUS_DENIED_TID_TO_LINK_MAPPING;
72047204
break;
72057205
case NEG_TTLM_RES_ACCEPT:
7206-
mgmt->u.action.u.ttlm_res.status_code = WLAN_STATUS_SUCCESS;
7206+
status_code = WLAN_STATUS_SUCCESS;
72077207
break;
72087208
case NEG_TTLM_RES_SUGGEST_PREFERRED:
7209-
mgmt->u.action.u.ttlm_res.status_code =
7210-
WLAN_STATUS_PREF_TID_TO_LINK_MAPPING_SUGGESTED;
7209+
status_code = WLAN_STATUS_PREF_TID_TO_LINK_MAPPING_SUGGESTED;
72117210
ieee80211_neg_ttlm_add_suggested_map(skb, neg_ttlm);
72127211
break;
72137212
}
72147213

7214+
mgmt->u.action.u.ttlm_res.status_code = cpu_to_le16(status_code);
72157215
ieee80211_tx_skb(sdata, skb);
72167216
}
72177217

@@ -7377,7 +7377,7 @@ void ieee80211_process_neg_ttlm_res(struct ieee80211_sub_if_data *sdata,
73777377
* This can be better implemented in the future, to handle request
73787378
* rejections.
73797379
*/
7380-
if (mgmt->u.action.u.ttlm_res.status_code != WLAN_STATUS_SUCCESS)
7380+
if (le16_to_cpu(mgmt->u.action.u.ttlm_res.status_code) != WLAN_STATUS_SUCCESS)
73817381
__ieee80211_disconnect(sdata);
73827382
}
73837383

0 commit comments

Comments
 (0)