FreeBSD Bugzilla – Attachment 156655 Details for
Bug 200128
[net80211] [patch]: exclude QoS Null frames from sequence number checking
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Do not check sequence number for QoS Null frames; set it for generated QoS Null frames to 0
patch-qos-null.diff (text/plain), 5.44 KB, created by
Andriy Voskoboinyk
on 2015-05-11 13:00:46 UTC
(
hide
)
Description:
Do not check sequence number for QoS Null frames; set it for generated QoS Null frames to 0
Filename:
MIME Type:
Creator:
Andriy Voskoboinyk
Created:
2015-05-11 13:00:46 UTC
Size:
5.44 KB
patch
obsolete
>Index: sys/net80211/ieee80211.h >=================================================================== >--- sys/net80211/ieee80211.h (revision 282543) >+++ sys/net80211/ieee80211.h (working copy) >@@ -169,6 +169,11 @@ > #define IEEE80211_FC1_PROTECTED 0x40 > #define IEEE80211_FC1_ORDER 0x80 > >+#define IEEE80211_HAS_SEQ(type, subtype) \ >+ ((type) != IEEE80211_FC0_TYPE_CTL && \ >+ !((type) == IEEE80211_FC0_TYPE_DATA && \ >+ ((subtype) & IEEE80211_FC0_SUBTYPE_QOS_NULL) == \ >+ IEEE80211_FC0_SUBTYPE_QOS_NULL)) > #define IEEE80211_SEQ_FRAG_MASK 0x000f > #define IEEE80211_SEQ_FRAG_SHIFT 0 > #define IEEE80211_SEQ_SEQ_MASK 0xfff0 >Index: sys/net80211/ieee80211_adhoc.c >=================================================================== >--- sys/net80211/ieee80211_adhoc.c (revision 282543) >+++ sys/net80211/ieee80211_adhoc.c (working copy) >@@ -291,7 +291,6 @@ > static int > adhoc_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) > { >-#define HAS_SEQ(type) ((type & 0x4) == 0) > struct ieee80211vap *vap = ni->ni_vap; > struct ieee80211com *ic = ni->ni_ic; > struct ifnet *ifp = vap->iv_ifp; >@@ -414,7 +413,8 @@ > } > IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); > ni->ni_noise = nf; >- if (HAS_SEQ(type) && IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { >+ if (IEEE80211_HAS_SEQ(type, subtype) && >+ IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { > uint8_t tid = ieee80211_gettid(wh); > if (IEEE80211_QOS_HAS_SEQ(wh) && > TID_TO_WME_AC(tid) >= WME_AC_VI) >Index: sys/net80211/ieee80211_hostap.c >=================================================================== >--- sys/net80211/ieee80211_hostap.c (revision 282543) >+++ sys/net80211/ieee80211_hostap.c (working copy) >@@ -478,7 +478,6 @@ > static int > hostap_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) > { >-#define HAS_SEQ(type) ((type & 0x4) == 0) > struct ieee80211vap *vap = ni->ni_vap; > struct ieee80211com *ic = ni->ni_ic; > struct ifnet *ifp = vap->iv_ifp; >@@ -571,7 +570,7 @@ > > IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); > ni->ni_noise = nf; >- if (HAS_SEQ(type)) { >+ if (IEEE80211_HAS_SEQ(type, subtype)) { > uint8_t tid = ieee80211_gettid(wh); > if (IEEE80211_QOS_HAS_SEQ(wh) && > TID_TO_WME_AC(tid) >= WME_AC_VI) >Index: sys/net80211/ieee80211_input.h >=================================================================== >--- sys/net80211/ieee80211_input.h (revision 282543) >+++ sys/net80211/ieee80211_input.h (working copy) >@@ -168,19 +168,22 @@ > { > #define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) > #define SEQ_EQ(a,b) ((int)((a)-(b)) == 0) >-#define HAS_SEQ(type) ((type & 0x4) == 0) > #define SEQNO(a) ((a) >> IEEE80211_SEQ_SEQ_SHIFT) > #define FRAGNO(a) ((a) & IEEE80211_SEQ_FRAG_MASK) > uint16_t rxseq; >- uint8_t type; >+ uint8_t type, subtype; > uint8_t tid; > struct ieee80211_rx_ampdu *rap; > > rxseq = le16toh(*(uint16_t *)wh->i_seq); > type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; >+ subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; > >- /* Types with no sequence number are always treated valid */ >- if (! HAS_SEQ(type)) >+ /* >+ * Types with no sequence number (or QoS (+)Null frames) >+ * are always treated valid. >+ */ >+ if (! IEEE80211_HAS_SEQ(type, subtype)) > return 1; > > tid = ieee80211_gettid(wh); >@@ -235,7 +238,6 @@ > return 1; > #undef SEQ_LEQ > #undef SEQ_EQ >-#undef HAS_SEQ > #undef SEQNO > #undef FRAGNO > } >Index: sys/net80211/ieee80211_output.c >=================================================================== >--- sys/net80211/ieee80211_output.c (revision 282543) >+++ sys/net80211/ieee80211_output.c (working copy) >@@ -730,7 +730,12 @@ > if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap)) > m->m_flags |= M_AMPDU_MPDU; > else { >- seqno = ni->ni_txseqs[tid]++; >+ if (IEEE80211_HAS_SEQ(type & IEEE80211_FC0_TYPE_MASK, >+ type & IEEE80211_FC0_SUBTYPE_MASK)) >+ seqno = ni->ni_txseqs[tid]++; >+ else >+ seqno = 0; >+ > *(uint16_t *)&wh->i_seq[0] = > htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); > M_SEQNO_SET(m, seqno); >Index: sys/net80211/ieee80211_sta.c >=================================================================== >--- sys/net80211/ieee80211_sta.c (revision 282543) >+++ sys/net80211/ieee80211_sta.c (working copy) >@@ -527,7 +527,6 @@ > static int > sta_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) > { >-#define HAS_SEQ(type) ((type & 0x4) == 0) > struct ieee80211vap *vap = ni->ni_vap; > struct ieee80211com *ic = ni->ni_ic; > struct ifnet *ifp = vap->iv_ifp; >@@ -623,7 +622,8 @@ > > IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); > ni->ni_noise = nf; >- if (HAS_SEQ(type) && !IEEE80211_IS_MULTICAST(wh->i_addr1)) { >+ if ( IEEE80211_HAS_SEQ(type, subtype) && >+ !IEEE80211_IS_MULTICAST(wh->i_addr1)) { > uint8_t tid = ieee80211_gettid(wh); > if (IEEE80211_QOS_HAS_SEQ(wh) && > TID_TO_WME_AC(tid) >= WME_AC_VI) >Index: sys/net80211/ieee80211_wds.c >=================================================================== >--- sys/net80211/ieee80211_wds.c (revision 282543) >+++ sys/net80211/ieee80211_wds.c (working copy) >@@ -406,7 +406,6 @@ > static int > wds_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) > { >-#define HAS_SEQ(type) ((type & 0x4) == 0) > struct ieee80211vap *vap = ni->ni_vap; > struct ieee80211com *ic = ni->ni_ic; > struct ifnet *ifp = vap->iv_ifp; >@@ -488,7 +487,7 @@ > } > IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); > ni->ni_noise = nf; >- if (HAS_SEQ(type)) { >+ if (IEEE80211_HAS_SEQ(type, subtype)) { > uint8_t tid = ieee80211_gettid(wh); > if (IEEE80211_QOS_HAS_SEQ(wh) && > TID_TO_WME_AC(tid) >= WME_AC_VI)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 200128
: 156655