net80211 seems to give us more rates than specified via ic_sup_rates under

yet to be investigated circumstances. If that happens truncate to the number
of rates that the firmware supports.

Found by:	Jeremie Le Hen
Obtained from:	OpenBSD (w/ changes)
MFC after:	3 days
This commit is contained in:
mlaier 2006-10-23 00:34:07 +00:00
parent d928160750
commit 2fda6e11e9
2 changed files with 7 additions and 1 deletions

View File

@ -2935,6 +2935,11 @@ iwi_auth_and_assoc(struct iwi_softc *sc)
IWI_MODE_11G;
rs.type = IWI_RATESET_TYPE_NEGOTIATED;
rs.nrates = ni->ni_rates.rs_nrates;
if (rs.nrates > IWI_RATESET_SIZE) {
DPRINTF(("Truncating negotiated rate set from %u\n",
rs.nrates));
rs.nrates = IWI_RATESET_SIZE;
}
memcpy(rs.rates, ni->ni_rates.rs_rates, rs.nrates);
DPRINTF(("Setting negotiated rates (%u)\n", rs.nrates));
error = iwi_cmd(sc, IWI_CMD_SET_RATES, &rs, sizeof rs);

View File

@ -338,7 +338,8 @@ struct iwi_rateset {
#define IWI_RATESET_TYPE_SUPPORTED 1
uint8_t reserved;
uint8_t rates[12];
#define IWI_RATESET_SIZE 12
uint8_t rates[IWI_RATESET_SIZE];
} __packed;
/* structure for command IWI_CMD_SET_TX_POWER */