wifi: don't query nl80211 for non-WiFi devices (bgo #740131)
The upstream kernel added module aliases for nl80211 in commit fb4e156886ce6e8309e912d8b370d192330d19d3, so querying nl80211 now auto-loads the module. Previously NM was doing this to determine whether an ethernet-like device was a Wi-Fi device that supported nl80211, but this leads to the nl80211 loading on platforms that will never have or use Wi-Fi. Since every nl80211-capable device will already have DEVTYPE=wlan set (from /sys/class/net/wlan0/uevent), we can use that as an indicator that the ethernet-like device is WiFi instead of asking nl80211. https://bugzilla.gnome.org/show_bug.cgi?id=740131
This commit is contained in:
@@ -766,7 +766,7 @@ link_type_from_udev (NMPlatform *platform, int ifindex, const char *ifname, int
|
||||
|
||||
prop = g_udev_device_get_property (udev_device, "DEVTYPE");
|
||||
sysfs_path = g_udev_device_get_sysfs_path (udev_device);
|
||||
if (g_strcmp0 (prop, "wlan") == 0 || wifi_utils_is_wifi (ifname, sysfs_path))
|
||||
if (wifi_utils_is_wifi (ifname, sysfs_path, prop))
|
||||
return_type (NM_LINK_TYPE_WIFI, "wifi");
|
||||
else if (g_strcmp0 (prop, "wwan") == 0)
|
||||
return_type (NM_LINK_TYPE_WWAN_ETHERNET, "wwan");
|
||||
|
Reference in New Issue
Block a user