diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2022-04-21 21:03:04 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2022-04-21 21:03:04 +0000 |
commit | 5b8cec784badf43f9162cd36d5e56d261be8f9a8 (patch) | |
tree | 6f10647f870997071135853fc19a9947433a6225 /sys/dev/ic/ar5008.c | |
parent | 4978e2ce49ea757952f61c0fea1381dcf4a086c6 (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/ar5008.c')
-rw-r--r-- | sys/dev/ic/ar5008.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ic/ar5008.c b/sys/dev/ic/ar5008.c index e9ff551127c..cad0f142210 100644 --- a/sys/dev/ic/ar5008.c +++ b/sys/dev/ic/ar5008.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5008.c,v 1.69 2021/10/11 09:01:05 stsp Exp $ */ +/* $OpenBSD: ar5008.c,v 1.70 2022/04/21 21:03:02 stsp Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -1039,7 +1039,7 @@ ar5008_rx_process(struct athn_softc *sc, struct mbuf_list *ml) m_adj(m, -IEEE80211_CRC_LEN); /* Send the frame to the 802.11 layer. */ - rxi.rxi_flags = 0; /* XXX */ + memset(&rxi, 0, sizeof(rxi)); rxi.rxi_rssi = MS(ds->ds_status4, AR_RXS4_RSSI_COMBINED); rxi.rxi_rssi += AR_DEFAULT_NOISE_FLOOR; rxi.rxi_tstamp = ds->ds_status2; |