From: stsp Date: Sat, 7 Jan 2023 11:09:16 +0000 (+0000) Subject: Make net80211 drop beacons received on secondary HT/VHT channels. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b5c5cec872990486cdfe9f0c2dd1c2410af32136;p=openbsd Make net80211 drop beacons received on secondary HT/VHT channels. Prevents iwm firmware panics and makes association work with 11ac APs which transmit beacons on channels other than their primary channel. We would use the wrong channel in such cases, and iwm would request a bogus channel configuration, which made the firmware unhappy. Tested by myself on iwm 8265 and florian on iwm 9260. This issue did likely affect iwx devices, too. ok mpi@ --- diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 220fe94908a..523bcfb9134 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.248 2022/12/27 20:13:03 patrick Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.249 2023/01/07 11:09:16 stsp Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -1693,7 +1693,12 @@ ieee80211_recv_probe_resp(struct ieee80211com *ic, struct mbuf *m, htcaps = frm; break; case IEEE80211_ELEMID_HTOP: + if (frm[1] < 22) { + ic->ic_stats.is_rx_elem_toosmall++; + break; + } htop = frm; + chan = frm[2]; break; case IEEE80211_ELEMID_VHTCAPS: vhtcaps = frm;