diff options
author | Andreas Henriksson <andreas@fatal.se> | 2018-04-24 19:25:40 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-04-24 21:27:25 +0200 |
commit | be2879018372054adc03896f757d75cdb4f87f08 (patch) | |
tree | 6d19e65554d8e1c9a1fa4b111ba6e938730d751a | |
parent | 9731b06b787afc95e0e493b3c67ef13020af0538 (diff) | |
download | NetworkManager-be2879018372054adc03896f757d75cdb4f87f08.tar.gz |
iwd: fix assertion failure when requesting scan
if device *is* a NM_DEVICE_IWD, then make sure to not pass that to
_nm_device_wifi_request_scan (which asserts on anything else than a
NM_DEVICE_WIFI device).
The crash can be triggered by enabling wifi.backend=iwd and clicking
on the 'select network' item in gnome shell for example. The journal
output looks like this:
NetworkManager[1861]: invalid cast from 'NMDeviceIwd' to 'NMDeviceWifi'
NetworkManager[1861]: **
NetworkManager[1861]: NetworkManager:ERROR:src/devices/wifi/nm-device-wifi.c:1127:_nm_device_wifi_request_scan: assertion failed: ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((_obj)); GType __t = ((nm_device_wifi_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))))
systemd[1]: NetworkManager.service: Main process exited, code=dumped, status=6/ABRT
systemd[1]: NetworkManager.service: Failed with result 'core-dump'.
Fixes: 297d4985abcc7b571b8c090ee90622357fc60e16
https://github.com/NetworkManager/NetworkManager/pull/107
-rw-r--r-- | src/devices/wifi/nm-wifi-common.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/devices/wifi/nm-wifi-common.c b/src/devices/wifi/nm-wifi-common.c index 47c0ce6784..e5e16f03e0 100644 --- a/src/devices/wifi/nm-wifi-common.c +++ b/src/devices/wifi/nm-wifi-common.c @@ -69,6 +69,7 @@ _dispatch_request_scan (NMDevice *device, _nm_device_iwd_request_scan (NM_DEVICE_IWD (device), options, invocation); + return; } #endif _nm_device_wifi_request_scan (NM_DEVICE_WIFI (device), |