aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Prestwood <prestwoj@gmail.com>2020-05-04 14:30:55 -0700
committerDenis Kenzior <denkenz@gmail.com>2020-05-01 20:42:58 -0500
commit3f2c84c2a2b716da36c01c609b6e594030ebc3e3 (patch)
treee3e66b3676894db2806efdd46d0195390de46382
parent76417829245d1ff11b8d9027d2ec1f652a583786 (diff)
downloadiwd-3f2c84c2a2b716da36c01c609b6e594030ebc3e3.tar.gz
netdev: fix segfault due to roaming before connected
In this situation the kernel is sending a low RSSI event which netdev picks up, but since we set netdev->connected so early the event is forwarded to station before IWD has fully connected. Station then tries to get a neighbor report, which may fail and cause a known frequency scan. If this is a new network the frequency scan tries to get any known frequencies in network_info which will be unset and cause a segfault. This can be avoided by only sending RSSI events when netdev->operational is set rather than netdev->connected.
-rw-r--r--src/netdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/netdev.c b/src/netdev.c
index 69f9ab851..b3c3bf730 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -678,7 +678,7 @@ static void netdev_cqm_event_rssi_threshold(struct netdev *netdev,
{
int event;
- if (!netdev->connected)
+ if (!netdev->operational)
return;
if (rssi_event != NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW &&