nl80211: Fix nla_put_u8 to u16 for NL80211_WMMR_TXOP
authorHaim Dreyfuss <haim.dreyfuss@intel.com>
Tue, 21 Aug 2018 06:22:19 +0000 (09:22 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 28 Aug 2018 09:37:28 +0000 (11:37 +0200)
TXOP (also known as Channel Occupancy Time) is u16 and should be
added using nla_put_u16 instead of u8, fix that.

Fixes: 50f32718e125 ("nl80211: Add wmm rule attribute to NL80211_CMD_GET_WIPHY dump command")
Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index e3dcffd96919ccda5c78e45c0171bbf9b7d3d693..3f7ffbe6c63499a0be2d4f4b989b5a954b1b62e2 100644 (file)
@@ -672,8 +672,8 @@ static int nl80211_msg_put_wmm_rules(struct sk_buff *msg,
                                rule->wmm_rule.client[j].cw_max) ||
                    nla_put_u8(msg, NL80211_WMMR_AIFSN,
                               rule->wmm_rule.client[j].aifsn) ||
-                   nla_put_u8(msg, NL80211_WMMR_TXOP,
-                              rule->wmm_rule.client[j].cot))
+                   nla_put_u16(msg, NL80211_WMMR_TXOP,
+                               rule->wmm_rule.client[j].cot))
                        goto nla_put_failure;
 
                nla_nest_end(msg, nl_wmm_rule);