summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2007-10-14 11:36:53 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2007-10-14 11:36:53 +0000
commit4a75b3d8935aef5f20ef47bcf666a88d67297fbb (patch)
tree9695e8f5a32bb6a40dae68d5403ca2d394d58fc5
parent542ada78f8c442e7ab00683b4747880fa8ed0450 (diff)
Fix a panic which happens with ACX100 chipsets in ieee80211_add_xrates()
because the drivers tries to set extended rates for a 11b chip. Tested and OK winiger@
-rw-r--r--sys/dev/ic/acx.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c
index 6108636fd36..d470ca0940b 100644
--- a/sys/dev/ic/acx.c
+++ b/sys/dev/ic/acx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acx.c,v 1.78 2007/10/01 04:03:51 krw Exp $ */
+/* $OpenBSD: acx.c,v 1.79 2007/10/14 11:36:52 mglocker Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -2344,6 +2344,7 @@ acx_set_probe_req_tmplt(struct acx_softc *sc, const char *ssid, int ssid_len)
struct ieee80211com *ic = &sc->sc_ic;
struct acx_tmplt_probe_req req;
struct ieee80211_frame *wh;
+ struct ieee80211_rateset *rs;
uint8_t *frm;
int len;
@@ -2359,8 +2360,10 @@ acx_set_probe_req_tmplt(struct acx_softc *sc, const char *ssid, int ssid_len)
frm = req.data.u_data.var;
frm = ieee80211_add_ssid(frm, ssid, ssid_len);
- frm = ieee80211_add_rates(frm, &ic->ic_sup_rates[sc->chip_phymode]);
- frm = ieee80211_add_xrates(frm, &ic->ic_sup_rates[sc->chip_phymode]);
+ rs = &ic->ic_sup_rates[sc->chip_phymode];
+ frm = ieee80211_add_rates(frm, rs);
+ if (rs->rs_nrates > IEEE80211_RATE_SIZE)
+ frm = ieee80211_add_xrates(frm, rs);
len = frm - req.data.u_data.var;
return (acx_set_tmplt(sc, ACXCMD_TMPLT_PROBE_REQ, &req,