summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2006-02-25 13:02:11 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2006-02-25 13:02:11 +0000
commite07db5015abfd9f4a331f99413b42fb86a397529 (patch)
tree085d42d027a3b80d913057d6a94b96f51ae04b8a
parent43b0628d6f729fd5b051e187f66bed4f81c07e5f (diff)
instead of panicing when tx rate is zero, fallback to 1Mbps.
this is a temporary workaround since we should really not see any node with an empty rate set but it seems to happen in hostap mode.
-rw-r--r--sys/dev/ic/rt2560.c7
-rw-r--r--sys/dev/ic/rt2661.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c
index 547e71047aa..3f7b843e45b 100644
--- a/sys/dev/ic/rt2560.c
+++ b/sys/dev/ic/rt2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2560.c,v 1.11 2006/02/18 09:41:41 damien Exp $ */
+/* $OpenBSD: rt2560.c,v 1.12 2006/02/25 13:02:10 damien Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -1877,9 +1877,8 @@ rt2560_tx_data(struct rt2560_softc *sc, struct mbuf *m0,
rate = rs->rs_rates[ni->ni_txrate];
}
rate &= IEEE80211_RATE_VAL;
-
- /* assert tx rate is non-null so we don't end up dividing by zero */
- KASSERT(rate != 0);
+ if (rate == 0)
+ rate = 2; /* fallback to 1Mbps; should not happen */
if (ic->ic_flags & IEEE80211_F_WEPON) {
m0 = ieee80211_wep_crypt(ifp, m0, 1);
diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c
index 6c7ec42e265..c662c3c2beb 100644
--- a/sys/dev/ic/rt2661.c
+++ b/sys/dev/ic/rt2661.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2661.c,v 1.11 2006/02/25 12:56:47 damien Exp $ */
+/* $OpenBSD: rt2661.c,v 1.12 2006/02/25 13:02:10 damien Exp $ */
/*-
* Copyright (c) 2006
@@ -1706,9 +1706,8 @@ rt2661_tx_data(struct rt2661_softc *sc, struct mbuf *m0,
rate = rs->rs_rates[ni->ni_txrate];
}
rate &= IEEE80211_RATE_VAL;
-
- /* assert tx rate is non-null so we don't end up dividing by zero */
- KASSERT(rate != 0);
+ if (rate == 0)
+ rate = 2; /* fallback to 1Mbps; should not happen */
if (ic->ic_flags & IEEE80211_F_WEPON) {
m0 = ieee80211_wep_crypt(ifp, m0, 1);