summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_ipw.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_ipw.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_ipw.c')
-rw-r--r--sys/dev/pci/if_ipw.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c
index 99c00d56d60..c8e367ab645 100644
--- a/sys/dev/pci/if_ipw.c
+++ b/sys/dev/pci/if_ipw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ipw.c,v 1.131 2022/03/11 18:00:45 mpi Exp $ */
+/* $OpenBSD: if_ipw.c,v 1.132 2022/04/21 21:03:03 stsp Exp $ */
/*-
* Copyright (c) 2004-2008
@@ -907,9 +907,8 @@ ipw_data_intr(struct ipw_softc *sc, struct ipw_status *status,
ni = ieee80211_find_rxnode(ic, wh);
/* send the frame to the upper layer */
- rxi.rxi_flags = 0;
+ memset(&rxi, 0, sizeof(rxi));
rxi.rxi_rssi = status->rssi;
- rxi.rxi_tstamp = 0; /* unused */
ieee80211_inputm(ifp, m, ni, &rxi, ml);
ieee80211_release_node(ic, ni);