From 78b14312ce3bc3f2f19970ab7c4ca9dac2135db4 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Fri, 15 Jun 2018 06:24:02 +0200 Subject: [PATCH] iwd: handle empty wireless mode as Infrastructure Blank mode property in the wireless settings is documented in libnm-core/nm-setting-wireless.c to mean infrastructure mode. (cherry picked from commit d01ba607a6aca0076ceace1d943a1ef0d2641f44) --- src/devices/wifi/nm-device-iwd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/devices/wifi/nm-device-iwd.c b/src/devices/wifi/nm-device-iwd.c index d28fcdbdc7..c652e7691c 100644 --- a/src/devices/wifi/nm-device-iwd.c +++ b/src/devices/wifi/nm-device-iwd.c @@ -545,7 +545,7 @@ check_connection_compatible (NMDevice *device, NMConnection *connection) return FALSE; mode = nm_setting_wireless_get_mode (s_wireless); - if (g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_INFRA) != 0) + if (mode && g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_INFRA) != 0) return FALSE; /* 8021x networks can only be used if they've been provisioned on the IWD side and @@ -575,7 +575,7 @@ check_connection_available (NMDevice *device, /* Only Infrastrusture mode at this time */ mode = nm_setting_wireless_get_mode (s_wifi); - if (g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_INFRA) != 0) + if (mode && g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_INFRA) != 0) return FALSE; /* Hidden SSIDs not supported yet */ @@ -630,7 +630,7 @@ complete_connection (NMDevice *device, mode = s_wifi ? nm_setting_wireless_get_mode (s_wifi) : NULL; - if (s_wifi && !nm_streq0 (mode, NM_SETTING_WIRELESS_MODE_INFRA)) { + if (mode && !nm_streq0 (mode, NM_SETTING_WIRELESS_MODE_INFRA)) { g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INVALID_CONNECTION, @@ -806,7 +806,7 @@ can_auto_connect (NMDevice *device, /* Only Infrastrusture mode */ mode = nm_setting_wireless_get_mode (s_wifi); - if (g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_INFRA) != 0) + if (mode && g_strcmp0 (mode, NM_SETTING_WIRELESS_MODE_INFRA) != 0) return FALSE; /* Don't autoconnect to networks that have been tried at least once