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@
-/* $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
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;