Re: [Madwifi-devel] Latest CVS update breaks wep
Status: Beta
Brought to you by:
otaku
From: <npe...@pe...> - 2004-01-15 23:04:24
|
Maybe I am reading this wrong, buy I understand you to be saying that the ic_nw_keys array is indexed from 1-4 instead of 0-3. This is not the case, only the API is. getiwkeyix returns the CURRENT key if a non 1-4 value is provided. The first value of ic->ic_wep_txkey should be 0 I think. nick > > By using a key index based at 1 rather than zero, the initial value > of ic_wep_txkey needs to be explicitly set to one (otherwise getiwkeyix > fails, causing the SIWENCODE ioctl, etc..). At the moment it's being > automatically set to zero on allocation of the ic struct. Also, the tx > descriptor setup needs to be changed, as it assumes that txkey can be > used as an index into the key table. > > I've attached the (trivial) patches to make it work for me. It should > probably be tested on more diverse hardware. :) > > --- if_ieee80211subr.c 2004-01-15 17:24:13.000000000 -0500 > +++ if_ieee80211subr.c.new 2004-01-15 17:07:26.000000000 -0500 > @@ -241,6 +241,7 @@ > * Setup crypto support. > */ > ieee80211_crc_init(); > + ic->ic_wep_txkey = 1; > get_random_bytes(&ic->ic_iv, sizeof(ic->ic_iv)); > > /* > > --- if_ath.c.old 2004-01-15 17:41:59.000000000 -0500 > +++ if_ath.c 2004-01-15 17:35:57.000000000 -0500 > @@ -2143,7 +2143,7 @@ > , atype /* Atheros packet type */ > , 60 /* txpower XXX */ > , txrate, try0 /* series 0 rate/tries */ > - , iswep ? sc->sc_ic.ic_wep_txkey : HAL_TXKEYIX_INVALID > + , iswep ? (sc->sc_ic.ic_wep_txkey - 1) : > HAL_TXKEYIX_INVALID > , antenna /* antenna mode */ > , flags /* flags */ > , ctsrate /* rts/cts rate */ > > |