summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_rtwn.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/pci/if_rtwn.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/pci/if_rtwn.c')
-rw-r--r--sys/dev/pci/if_rtwn.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/pci/if_rtwn.c b/sys/dev/pci/if_rtwn.c
index ffd1dbe539f..8961e892132 100644
--- a/sys/dev/pci/if_rtwn.c
+++ b/sys/dev/pci/if_rtwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rtwn.c,v 1.39 2022/03/15 09:22:56 stsp Exp $ */
+/* $OpenBSD: if_rtwn.c,v 1.40 2022/04/21 21:03:03 stsp Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -972,9 +972,8 @@ rtwn_rx_frame(struct rtwn_pci_softc *sc, struct r92c_rx_desc_pci *rx_desc,
#endif
ni = ieee80211_find_rxnode(ic, wh);
- rxi.rxi_flags = 0;
+ memset(&rxi, 0, sizeof(rxi));
rxi.rxi_rssi = rssi;
- rxi.rxi_tstamp = 0; /* Unused. */
ieee80211_inputm(ifp, m, ni, &rxi, ml);
/* Node is no longer needed. */
ieee80211_release_node(ic, ni);