summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-10-13 03:42:53 +0000
committersam <sam@FreeBSD.org>2003-10-13 03:42:53 +0000
commit725572efdacc819dce829edb301e4edc87502fe0 (patch)
tree57237d2e3dbd4376c95c96d422866b4f367fe21a /sys/dev/ath
parent04745ccf4c58682033e85ca6acd947ebc25e8bc4 (diff)
downloadFreeBSD-src-725572efdacc819dce829edb301e4edc87502fe0.zip
FreeBSD-src-725572efdacc819dce829edb301e4edc87502fe0.tar.gz
Reduce per-packet overhead when using WEP by using an advancing IV
seeded with arc4random rather than calling arc4random for each packet. Note this is the same algorithm used to select the IV when doing WEP on the host.
Diffstat (limited to 'sys/dev/ath')
-rw-r--r--sys/dev/ath/if_ath.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 1369f93..e5c6fb0 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -1735,7 +1735,14 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf
* So we use pseudo random IV for now, though it is not the
* right way.
*/
- iv = arc4random();
+ iv = ic->ic_iv;
+ /*
+ * Skip 'bad' IVs from Fluhrer/Mantin/Shamir:
+ * (B, 255, N) with 3 <= B < 8
+ */
+ if (iv >= 0x03ff00 && (iv & 0xf8ff00) == 0x00ff00)
+ iv += 0x000100;
+ ic->ic_iv = iv + 1;
for (i = 0; i < IEEE80211_WEP_IVLEN; i++) {
ivp[i] = iv;
iv >>= 8;
OpenPOWER on IntegriCloud