On Sat, Jan 12, 2019 at 12:28:04PM -0700, martian67 wrote:
> 
> > Are you implying that these panics do not occur if your athn(4) hostap
> > is in 11a/g mode instead of 11n? That would be useful to know.
> > 
> 
> Sorry I was not more explicit with my testing, running an ifconfig
> random up/down loop + a random re-association loop on the client, when
> placed into g mode there does not appear to be an issue after about half
> an hour (This card does not support 802.11a). It does indeed appear to
> be restricted to 802.11n.
> 

Could you please try this diff and tell me if it makes a difference?

diff 85d5a2d13c62494befd8404b760a73f8146aa70a /usr/src
blob - 24fd9c068968a041fcff497be8fdaa8705995001
file + sys/net80211/ieee80211_input.c
--- sys/net80211/ieee80211_input.c
+++ sys/net80211/ieee80211_input.c
@@ -210,11 +210,29 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, str
                tid = 0;
        }
 
-       if (type == IEEE80211_FC0_TYPE_DATA && hasqos &&
+       if (ic->ic_state == IEEE80211_S_RUN &&
+           type == IEEE80211_FC0_TYPE_DATA && hasqos &&
            (subtype & IEEE80211_FC0_SUBTYPE_NODATA) == 0 &&
-           !(rxi->rxi_flags & IEEE80211_RXI_AMPDU_DONE)) {
+           !(rxi->rxi_flags & IEEE80211_RXI_AMPDU_DONE)
+#ifndef IEEE80211_STA_ONLY
+           && (ic->ic_opmode == IEEE80211_M_STA || ni != ic->ic_bss)
+#endif
+           ) {
                int ba_state = ni->ni_rx_ba[tid].ba_state;
 
+#ifndef IEEE80211_STA_ONLY
+               if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
+                       if (!IEEE80211_ADDR_EQ(wh->i_addr1,
+                           ic->ic_bss->ni_bssid)) {
+                               ic->ic_stats.is_rx_wrongbss++;
+                               goto err;
+                       }
+                       if (ni->ni_state != IEEE80211_S_ASSOC) {
+                               ic->ic_stats.is_rx_notassoc++;
+                               goto err;
+                       }
+               }
+#endif
                /* 
                 * If Block Ack was explicitly requested, check
                 * if we have a BA agreement for this RA/TID.

Reply via email to