platform: wifi: use nmp_utils_open_sysctl() to check if device is wifi

Since function nmp_utils_open_sysctl() can avoid race condition, use it
in wifi_utils_is_wifi() to open sysfs and correctly check if it's a wifi
device.

https://bugzilla.gnome.org/show_bug.cgi?id=775613
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
This commit is contained in:
Kai-Heng Feng
2016-12-07 18:40:09 +08:00
committed by Thomas Haller
parent 713c74f6e4
commit b95556eb78
3 changed files with 26 additions and 11 deletions

View File

@@ -721,7 +721,7 @@ _linktype_get_type (NMPlatform *platform,
}
/* Fallback for drivers that don't call SET_NETDEV_DEVTYPE() */
if (wifi_utils_is_wifi (ifname))
if (wifi_utils_is_wifi (ifindex, ifname))
return NM_LINK_TYPE_WIFI;
if (arptype == ARPHRD_ETHER) {