Linux clients won't use 11n with an AP unless the AP provides WME parameters.

This is the reverse of the problem we had when Linux APs did not want
to use 11n with OpenBSD clients who did not send a wme info element in
association requests.

Tested with 11n-enabled athn(4) OpenBSD hostap and an Ubuntu client.

ok?

Index: ieee80211_output.c
===================================================================
RCS file: /cvs/src/sys/net80211/ieee80211_output.c,v
retrieving revision 1.112
diff -u -p -r1.112 ieee80211_output.c
--- ieee80211_output.c  9 Jan 2017 09:30:02 -0000       1.112
+++ ieee80211_output.c  9 Jan 2017 11:54:41 -0000
@@ -1207,7 +1207,7 @@ ieee80211_get_probe_resp(struct ieee8021
            (((ic->ic_flags & IEEE80211_F_RSNON) &&
              (ic->ic_bss->ni_rsnprotos & IEEE80211_PROTO_WPA)) ?
                2 + IEEE80211_WPAIE_MAXLEN : 0) +
-           ((ic->ic_flags & IEEE80211_F_HTON) ? 28 + 24 : 0));
+           ((ic->ic_flags & IEEE80211_F_HTON) ? 28 + 24 + 26 : 0));
        if (m == NULL)
                return NULL;
 
@@ -1236,6 +1236,7 @@ ieee80211_get_probe_resp(struct ieee8021
        if (ic->ic_flags & IEEE80211_F_HTON) {
                frm = ieee80211_add_htcaps(frm, ic);
                frm = ieee80211_add_htop(frm, ic);
+               frm = ieee80211_add_wme_param(frm, ic);
        }
 
        m->m_pkthdr.len = m->m_len = frm - mtod(m, u_int8_t *);
@@ -1397,7 +1398,7 @@ ieee80211_get_assoc_resp(struct ieee8021
                2 + rs->rs_nrates - IEEE80211_RATE_SIZE : 0) +
            ((ni->ni_flags & IEEE80211_NODE_QOS) ? 2 + 18 : 0) +
            ((status == IEEE80211_STATUS_TRY_AGAIN_LATER) ? 2 + 7 : 0) +
-           ((ic->ic_flags & IEEE80211_F_HTON) ? 28 + 24 : 0));
+           ((ic->ic_flags & IEEE80211_F_HTON) ? 28 + 24 + 26 : 0));
        if (m == NULL)
                return NULL;
 
@@ -1422,6 +1423,7 @@ ieee80211_get_assoc_resp(struct ieee8021
        if (ic->ic_flags & IEEE80211_F_HTON) {
                frm = ieee80211_add_htcaps(frm, ic);
                frm = ieee80211_add_htop(frm, ic);
+               frm = ieee80211_add_wme_param(frm, ic);
        }
 
        m->m_pkthdr.len = m->m_len = frm - mtod(m, u_int8_t *);
@@ -1825,7 +1827,7 @@ ieee80211_beacon_alloc(struct ieee80211c
            (((ic->ic_flags & IEEE80211_F_RSNON) &&
              (ni->ni_rsnprotos & IEEE80211_PROTO_WPA)) ?
                2 + IEEE80211_WPAIE_MAXLEN : 0) +
-           ((ic->ic_flags & IEEE80211_F_HTON) ? 28 + 24 : 0));
+           ((ic->ic_flags & IEEE80211_F_HTON) ? 28 + 24 + 26 : 0));
        if (m == NULL)
                return NULL;
 
@@ -1871,6 +1873,7 @@ ieee80211_beacon_alloc(struct ieee80211c
        if (ic->ic_flags & IEEE80211_F_HTON) {
                frm = ieee80211_add_htcaps(frm, ic);
                frm = ieee80211_add_htop(frm, ic);
+               frm = ieee80211_add_wme_param(frm, ic);
        }
 
        m->m_pkthdr.len = m->m_len = frm - mtod(m, u_int8_t *);

Reply via email to