If the stack demands protection by setting the USEPROT flag then set the
authorstsp <stsp@openbsd.org>
Wed, 17 Aug 2016 09:39:38 +0000 (09:39 +0000)
committerstsp <stsp@openbsd.org>
Wed, 17 Aug 2016 09:39:38 +0000 (09:39 +0000)
corresponding bit in the iwm(4) Tx command regardless of frame length.
ok sthen@

sys/dev/pci/if_iwm.c

index a79362f..58d7272 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_iwm.c,v 1.98 2016/08/15 12:59:53 stsp Exp $        */
+/*     $OpenBSD: if_iwm.c,v 1.99 2016/08/17 09:39:38 stsp Exp $        */
 
 /*
  * Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -4515,11 +4515,11 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ieee80211_node *ni, int ac)
                flags |= IWM_TX_CMD_FLG_ACK;
        }
 
-       if (type == IEEE80211_FC0_TYPE_DATA
-           && (totlen + IEEE80211_CRC_LEN > ic->ic_rtsthreshold)
-           && !IEEE80211_IS_MULTICAST(wh->i_addr1)) {
+       if (type == IEEE80211_FC0_TYPE_DATA &&
+           !IEEE80211_IS_MULTICAST(wh->i_addr1) &&
+           (totlen + IEEE80211_CRC_LEN > ic->ic_rtsthreshold ||
+           (ic->ic_flags & IEEE80211_F_USEPROT)))
                flags |= IWM_TX_CMD_FLG_PROT_REQUIRE;
-       }
 
        if (IEEE80211_IS_MULTICAST(wh->i_addr1) ||
            type != IEEE80211_FC0_TYPE_DATA)