diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-06-27 04:14:24 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-06-27 04:14:24 +0000 |
commit | 192dbc92c9f48eb21d98e54fa0e3746c7c42f065 (patch) | |
tree | 55ac9abed67c12f32452ac7592ff570d8bd0626f /sys | |
parent | 8f1459f63d6615bb6d629fab3c288d3702868412 (diff) |
Hack to avoid panic in arc4maybeinit() due to rnd device not being
attached yet.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net80211/ieee80211_crypto.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index 055caf247a6..6f79d9d5fb1 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto.c,v 1.1 2004/06/22 22:53:52 millert Exp $ */ +/* $OpenBSD: ieee80211_crypto.c,v 1.2 2004/06/27 04:14:23 millert Exp $ */ /* $NetBSD: ieee80211_crypto.c,v 1.5 2003/12/14 09:56:53 dyoung Exp $ */ /*- @@ -113,13 +113,10 @@ static u_int32_t ieee80211_crc_update(u_int32_t crc, u_int8_t *buf, int len); void ieee80211_crypto_attach(struct ifnet *ifp) { - struct ieee80211com *ic = (void *)ifp; - /* * Setup crypto support. */ ieee80211_crc_init(); - ic->ic_iv = arc4random(); } void @@ -195,7 +192,7 @@ ieee80211_wep_crypt(struct ifnet *ifp, struct mbuf *m0, int txflag) if (txflag) { kid = ic->ic_wep_txkey; wh->i_fc[1] |= IEEE80211_FC1_WEP; - iv = ic->ic_iv; + iv = ic->ic_iv ? ic->ic_iv : arc4random(); /* * Skip 'bad' IVs from Fluhrer/Mantin/Shamir: * (B, 255, N) with 3 <= B < 8 |