summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwi/if_iwi.c
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2006-10-23 00:34:07 +0000
committermlaier <mlaier@FreeBSD.org>2006-10-23 00:34:07 +0000
commit2fda6e11e96b7e11228416efe0f63ecae26e904d (patch)
treec2577d58c353234de5f8a84744048b95e5b71403 /sys/dev/iwi/if_iwi.c
parentd9281607508ee6f6d12781efbab55502df85e247 (diff)
downloadFreeBSD-src-2fda6e11e96b7e11228416efe0f63ecae26e904d.zip
FreeBSD-src-2fda6e11e96b7e11228416efe0f63ecae26e904d.tar.gz
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
Diffstat (limited to 'sys/dev/iwi/if_iwi.c')
-rw-r--r--sys/dev/iwi/if_iwi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index e88e99d..2451281 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -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);
OpenPOWER on IntegriCloud