From da7b8dd85043d0bd2e33c4166b72bbde969b94a2 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sat, 10 Dec 2016 16:30:42 +0100 Subject: [PATCH] wifi: remove check for existing device in wifi_wext_is_wifi() See also commit ab41c13b0611c6cc967b055d328637a143b5c59b. --- src/platform/wifi/wifi-utils-wext.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/platform/wifi/wifi-utils-wext.c b/src/platform/wifi/wifi-utils-wext.c index 398f3c558f..af8cf2dee6 100644 --- a/src/platform/wifi/wifi-utils-wext.c +++ b/src/platform/wifi/wifi-utils-wext.c @@ -662,8 +662,15 @@ wifi_wext_is_wifi (const char *iface) struct iwreq iwr; gboolean is_wifi = FALSE; - if (!nmp_utils_device_exists (iface)) - return FALSE; + /* performing an ioctl on a non-existing name may cause the automatic + * loading of kernel modules, which should be avoided. + * + * Usually, we should thus make sure that an inteface with this name + * exists. + * + * Note that wifi_wext_is_wifi() has only one caller which just verified + * that an interface with this name exists. + */ fd = socket (PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); if (fd >= 0) {