Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/dev/usb Fix access to QOS data



details:   https://anonhg.NetBSD.org/src-all/rev/ddb7c253459e
branches:  trunk
changeset: 371684:ddb7c253459e
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Mon Aug 15 17:21:30 2022 +0200

description:
Fix access to QOS data

diffstat:

 sys/dev/usb/usbwifi.c |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 7431f6f55f75 -r ddb7c253459e sys/dev/usb/usbwifi.c
--- a/sys/dev/usb/usbwifi.c     Mon Aug 15 17:19:43 2022 +0200
+++ b/sys/dev/usb/usbwifi.c     Mon Aug 15 17:21:30 2022 +0200
@@ -811,8 +811,12 @@
                qid = WME_AC_BE;
                if (IEEE80211_QOS_HAS_SEQ(wh)) {
                        /* data frames in 11n mode */
-                       struct ieee80211_qosframe *qwh = (void *)wh;
-                       uint8_t tid = qwh->i_qos[0] & IEEE80211_QOS_TID;
+                       uint8_t *frm, tid;
+                       uint16_t qos;
+
+                       frm = ieee80211_getqos(wh);
+                       qos = le16toh(*(const uint16_t *)frm);
+                       tid = qos & IEEE80211_QOS_TID;
                        qid = TID_TO_WME_AC(tid);
                } else if (type != IEEE80211_FC0_TYPE_DATA) {
                        qid = WME_AC_VO;
@@ -909,8 +913,12 @@
        qid = WME_AC_BE;
        if (IEEE80211_QOS_HAS_SEQ(wh)) {
                /* data frames in 11n mode */
-               struct ieee80211_qosframe *qwh = (void *)wh;
-               uint8_t tid = qwh->i_qos[0] & IEEE80211_QOS_TID;
+               uint8_t *frm, tid;
+               uint16_t qos;
+
+               frm = ieee80211_getqos(wh);
+               qos = le16toh(*(const uint16_t *)frm);
+               tid = qos & IEEE80211_QOS_TID;
                qid = TID_TO_WME_AC(tid);
        } else if (type != IEEE80211_FC0_TYPE_DATA) {
                qid = WME_AC_VO;



Home | Main Index | Thread Index | Old Index