summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamien <damien@openbsd.org>2006-12-17 16:24:00 +0000
committerdamien <damien@openbsd.org>2006-12-17 16:24:00 +0000
commitd6d4ba2461a37b14b0ce6f1e5bae0ba4de2dba91 (patch)
tree3331ff4e9a485cbcd0340abc65a09c5737a80988
parentadd a little spacing here, to please mglocker (diff)
downloadwireguard-openbsd-d6d4ba2461a37b14b0ce6f1e5bae0ba4de2dba91.tar.xz
wireguard-openbsd-d6d4ba2461a37b14b0ce6f1e5bae0ba4de2dba91.zip
fix index of ERP information element in beacons.
still ugly, but correct.
-rw-r--r--sys/dev/ic/rt2560.c12
-rw-r--r--sys/dev/ic/rt2661.c12
2 files changed, 14 insertions, 10 deletions
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c
index 30fa917b646..c5d327643e0 100644
--- a/sys/dev/ic/rt2560.c
+++ b/sys/dev/ic/rt2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2560.c,v 1.28 2006/12/03 16:39:13 damien Exp $ */
+/* $OpenBSD: rt2560.c,v 1.29 2006/12/17 16:24:00 damien Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -1581,10 +1581,12 @@ rt2560_tx_bcn(struct rt2560_softc *sc, struct mbuf *m0,
sc->erp =
mtod(m0, uint8_t *) +
sizeof (struct ieee80211_frame) +
- 8 + 2 + 2 + 2 + ni->ni_esslen + 2 + 1 +
- ((ic->ic_opmode == IEEE80211_M_IBSS) ? 3 : 6) +
- 2 + ni->ni_rates.rs_nrates +
- ((ni->ni_rates.rs_nrates > IEEE80211_RATE_SIZE) ? 2 : 0) +
+ 8 + 2 + 2 +
+ ((ic->ic_flags & IEEE80211_F_HIDENWID) ?
+ 1 : 2 + ni->ni_esslen) +
+ 2 + min(ni->ni_rates.rs_nrates, IEEE80211_RATE_SIZE) +
+ 2 + 1 +
+ ((ic->ic_opmode == IEEE80211_M_IBSS) ? 4 : 6) +
2;
}
diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c
index 49a571e2dba..ca383414cf8 100644
--- a/sys/dev/ic/rt2661.c
+++ b/sys/dev/ic/rt2661.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2661.c,v 1.33 2006/12/03 16:39:13 damien Exp $ */
+/* $OpenBSD: rt2661.c,v 1.34 2006/12/17 16:24:00 damien Exp $ */
/*-
* Copyright (c) 2006
@@ -2828,10 +2828,12 @@ rt2661_prepare_beacon(struct rt2661_softc *sc)
sc->erp_csr =
RT2661_HW_BEACON_BASE0 + 24 +
sizeof (struct ieee80211_frame) +
- 8 + 2 + 2 + 2 + ni->ni_esslen + 2 + 1 +
- ((ic->ic_opmode == IEEE80211_M_IBSS) ? 3 : 6) +
- 2 + ni->ni_rates.rs_nrates +
- ((ni->ni_rates.rs_nrates > IEEE80211_RATE_SIZE) ? 2 : 0) +
+ 8 + 2 + 2 +
+ ((ic->ic_flags & IEEE80211_F_HIDENWID) ?
+ 1 : 2 + ni->ni_esslen) +
+ 2 + min(ni->ni_rates.rs_nrates, IEEE80211_RATE_SIZE) +
+ 2 + 1 +
+ ((ic->ic_opmode == IEEE80211_M_IBSS) ? 4 : 6) +
2;
}