From: stsp Date: Mon, 18 Jul 2016 13:09:58 +0000 (+0000) Subject: Fix inverted logic in iwm_tx(). The PROT_REQUIRE flag in should be set for X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e9c5d29511d5a5c45c593b4fe8202c87c07ac987;p=openbsd Fix inverted logic in iwm_tx(). The PROT_REQUIRE flag in should be set for data frames above a certain length, but we were setting it for !data frames above a certain length, which makes no sense at all. Found while comparing our driver's Tx code to iwlwifi. ok mpi@ --- diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index 21675f6e517..96cd14948ea 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.93 2016/07/18 13:09:08 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.94 2016/07/18 13:09:58 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -4517,7 +4517,7 @@ 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 + if (type == IEEE80211_FC0_TYPE_DATA && (totlen + IEEE80211_CRC_LEN > ic->ic_rtsthreshold) && !IEEE80211_IS_MULTICAST(wh->i_addr1)) { flags |= IWM_TX_CMD_FLG_PROT_REQUIRE;