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/malo.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/malo.c')
-rw-r--r-- | sys/dev/ic/malo.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/ic/malo.c b/sys/dev/ic/malo.c index 6e7efb3f1cc..ab5511d082c 100644 --- a/sys/dev/ic/malo.c +++ b/sys/dev/ic/malo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malo.c,v 1.122 2022/01/09 05:42:38 jsg Exp $ */ +/* $OpenBSD: malo.c,v 1.123 2022/04/21 21:03:02 stsp Exp $ */ /* * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org> @@ -1709,9 +1709,8 @@ malo_rx_intr(struct malo_softc *sc) ni = ieee80211_find_rxnode(ic, wh); /* send the frame to the 802.11 layer */ - rxi.rxi_flags = 0; + memset(&rxi, 0, sizeof(rxi)); rxi.rxi_rssi = desc->rssi; - rxi.rxi_tstamp = 0; /* unused */ ieee80211_inputm(ifp, m, ni, &rxi, &ml); /* node is no longer needed */ |