commit 755280a4cc1e258516685319c220093debf063d6
parent df2c5cf7fa5a9424497a60f69f8bb0c0bc610eb7
Author: James Prestwood <prestwoj@gmail.com>
Date: Mon, 18 Aug 2025 07:30:38 -0700
netdev: check connected in channel switch event
In an ideal world userspace should never be getting a channel switch
event unless connected to an AP, but alas this has been seen at least
with ath10k hardware. This causes IWD to crash since the logic
assumes netdev->handshake is set.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/netdev.c b/src/netdev.c
@@ -5417,6 +5417,9 @@ static void netdev_channel_switch_event(struct l_genl_msg *msg,
if (netdev->type != NL80211_IFTYPE_STATION)
return;
+ if (L_WARN_ON(!netdev->connected))
+ return;
+
chandef = l_new(struct band_chandef, 1);
if (nl80211_parse_chandef(msg, chandef) < 0) {