Skip to content

Commit a84ec3d

Browse files
Michael-CY Leesmb49
authored andcommitted
wifi: mac80211: fix the type of status_code for negotiated TID to Link Mapping
BugLink: https://bugs.launchpad.net/bugs/2115252 [ 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]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 0df1fc5 commit a84ec3d

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
@@ -1526,7 +1526,7 @@ struct ieee80211_mgmt {
15261526
struct {
15271527
u8 action_code;
15281528
u8 dialog_token;
1529-
u8 status_code;
1529+
__le16 status_code;
15301530
u8 variable[];
15311531
} __packed ttlm_res;
15321532
struct {

net/mac80211/mlme.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7412,6 +7412,7 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata,
74127412
int hdr_len = offsetofend(struct ieee80211_mgmt, u.action.u.ttlm_res);
74137413
int ttlm_max_len = 2 + 1 + sizeof(struct ieee80211_ttlm_elem) + 1 +
74147414
2 * 2 * IEEE80211_TTLM_NUM_TIDS;
7415+
u16 status_code;
74157416

74167417
skb = dev_alloc_skb(local->tx_headroom + hdr_len + ttlm_max_len);
74177418
if (!skb)
@@ -7434,19 +7435,18 @@ ieee80211_send_neg_ttlm_res(struct ieee80211_sub_if_data *sdata,
74347435
WARN_ON(1);
74357436
fallthrough;
74367437
case NEG_TTLM_RES_REJECT:
7437-
mgmt->u.action.u.ttlm_res.status_code =
7438-
WLAN_STATUS_DENIED_TID_TO_LINK_MAPPING;
7438+
status_code = WLAN_STATUS_DENIED_TID_TO_LINK_MAPPING;
74397439
break;
74407440
case NEG_TTLM_RES_ACCEPT:
7441-
mgmt->u.action.u.ttlm_res.status_code = WLAN_STATUS_SUCCESS;
7441+
status_code = WLAN_STATUS_SUCCESS;
74427442
break;
74437443
case NEG_TTLM_RES_SUGGEST_PREFERRED:
7444-
mgmt->u.action.u.ttlm_res.status_code =
7445-
WLAN_STATUS_PREF_TID_TO_LINK_MAPPING_SUGGESTED;
7444+
status_code = WLAN_STATUS_PREF_TID_TO_LINK_MAPPING_SUGGESTED;
74467445
ieee80211_neg_ttlm_add_suggested_map(skb, neg_ttlm);
74477446
break;
74487447
}
74497448

7449+
mgmt->u.action.u.ttlm_res.status_code = cpu_to_le16(status_code);
74507450
ieee80211_tx_skb(sdata, skb);
74517451
}
74527452

@@ -7612,7 +7612,7 @@ void ieee80211_process_neg_ttlm_res(struct ieee80211_sub_if_data *sdata,
76127612
* This can be better implemented in the future, to handle request
76137613
* rejections.
76147614
*/
7615-
if (mgmt->u.action.u.ttlm_res.status_code != WLAN_STATUS_SUCCESS)
7615+
if (le16_to_cpu(mgmt->u.action.u.ttlm_res.status_code) != WLAN_STATUS_SUCCESS)
76167616
__ieee80211_disconnect(sdata);
76177617
}
76187618

0 commit comments

Comments
 (0)