diff options
Diffstat (limited to 'src/supplicant/nm-supplicant-manager.c')
| -rw-r--r-- | src/supplicant/nm-supplicant-manager.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/supplicant/nm-supplicant-manager.c b/src/supplicant/nm-supplicant-manager.c index 2fbfa391..cf53fb41 100644 --- a/src/supplicant/nm-supplicant-manager.c +++ b/src/supplicant/nm-supplicant-manager.c @@ -37,7 +37,7 @@ typedef struct { gboolean running; GSList *ifaces; - gboolean fast_supported; + NMSupplicantFeature fast_support; NMSupplicantFeature ap_support; guint die_count_reset_id; guint die_count; @@ -158,7 +158,7 @@ nm_supplicant_manager_create_interface (NMSupplicantManager *self, iface = nm_supplicant_interface_new (ifname, driver, - priv->fast_supported, + priv->fast_support, priv->ap_support); priv->ifaces = g_slist_prepend (priv->ifaces, iface); @@ -217,21 +217,32 @@ update_capabilities (NMSupplicantManager *self) (priv->ap_support == NM_SUPPLICANT_FEATURE_NO) ? "not " : "possibly "); /* EAP-FAST */ - priv->fast_supported = FALSE; + priv->fast_support = NM_SUPPLICANT_FEATURE_NO; value = g_dbus_proxy_get_cached_property (priv->proxy, "EapMethods"); if (value) { if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING_ARRAY)) { array = g_variant_get_strv (value, NULL); if (array) { - if (g_strv_contains (array, "fast")) - priv->fast_supported = TRUE; + const char **a; + + for (a = array; *a; a++) { + if (g_ascii_strcasecmp (*a, "FAST") == 0) { + priv->fast_support = NM_SUPPLICANT_FEATURE_YES; + break; + } + } g_free (array); } } g_variant_unref (value); } - _LOGD ("EAP-FAST is %ssupported", priv->fast_supported ? "" : "not "); + for (ifaces = priv->ifaces; ifaces; ifaces = ifaces->next) + nm_supplicant_interface_set_fast_support (ifaces->data, priv->fast_support); + + _LOGD ("EAP-FAST is %ssupported", + (priv->fast_support == NM_SUPPLICANT_FEATURE_YES) ? "" : + (priv->fast_support == NM_SUPPLICANT_FEATURE_NO) ? "not " : "possibly "); } static void @@ -306,8 +317,8 @@ name_owner_cb (GDBusProxy *proxy, GParamSpec *pspec, gpointer user_data) _LOGI ("wpa_supplicant %s", owner ? "running" : "stopped"); if (owner) { - set_running (self, TRUE); update_capabilities (self); + set_running (self, TRUE); } else if (priv->running) { /* Reschedule the die count reset timeout. Every time the supplicant * dies we wait 10 seconds before resetting the counter. If the @@ -324,9 +335,10 @@ name_owner_cb (GDBusProxy *proxy, GParamSpec *pspec, gpointer user_data) priv->die_count); } - set_running (self, FALSE); + priv->ap_support = NM_SUPPLICANT_FEATURE_UNKNOWN; + priv->fast_support = NM_SUPPLICANT_FEATURE_UNKNOWN; - priv->fast_supported = FALSE; + set_running (self, FALSE); } g_free (owner); |