summaryrefslogtreecommitdiff
path: root/sys/dev/ic/rt2860.c
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2022-04-21 21:03:04 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2022-04-21 21:03:04 +0000
commit5b8cec784badf43f9162cd36d5e56d261be8f9a8 (patch)
tree6f10647f870997071135853fc19a9947433a6225 /sys/dev/ic/rt2860.c
parent4978e2ce49ea757952f61c0fea1381dcf4a086c6 (diff)
Use memset() to initialize struct ieee80211_rxinfo properly.
Sven Wolf noticed that scans on ral(4) are buggy ever since I added a new field to this struct. Turns out a lot of drivers were initializing fields one-by-one, leaving any newly added fields uninitialized by default. Affected drivers may report wrong channel numbers for received beacons. The net80211 stack will discard such beacons, assuming they were received on the wrong channel due to signal leakage. Scanning is broken as result. ok miod@
Diffstat (limited to 'sys/dev/ic/rt2860.c')
-rw-r--r--sys/dev/ic/rt2860.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c
index 3178226c0b6..55b76f4404a 100644
--- a/sys/dev/ic/rt2860.c
+++ b/sys/dev/ic/rt2860.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2860.c,v 1.101 2020/12/12 11:48:52 jan Exp $ */
+/* $OpenBSD: rt2860.c,v 1.102 2022/04/21 21:03:02 stsp Exp $ */
/*-
* Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -1349,7 +1349,7 @@ rt2860_rx_intr(struct rt2860_softc *sc)
m->m_pkthdr.len = m->m_len = letoh16(rxwi->len) & 0xfff;
wh = mtod(m, struct ieee80211_frame *);
- rxi.rxi_flags = 0;
+ memset(&rxi, 0, sizeof(rxi));
if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
/* frame is decrypted by hardware */
wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED;
@@ -1413,7 +1413,6 @@ skipbpf:
/* send the frame to the 802.11 layer */
rxi.rxi_rssi = rssi;
- rxi.rxi_tstamp = 0; /* unused */
ieee80211_inputm(ifp, m, ni, &rxi, &ml);
/* node is no longer needed */