supplicant: update whether EAP-FAST is supported for existing supplicant-interface
As the fast-supported flag changes, update the existing supplicant interfaces with the new information. Also, by default assume it is supported.
This commit is contained in:
@@ -57,15 +57,15 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSupplicantInterface,
|
||||
PROP_SCANNING,
|
||||
PROP_CURRENT_BSS,
|
||||
PROP_DRIVER,
|
||||
PROP_FAST_SUPPORTED,
|
||||
PROP_FAST_SUPPORT,
|
||||
PROP_AP_SUPPORT,
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
char * dev;
|
||||
NMSupplicantDriver driver;
|
||||
bool fast_supported;
|
||||
gboolean has_credreq; /* Whether querying 802.1x credentials is supported */
|
||||
NMSupplicantFeature fast_support;
|
||||
NMSupplicantFeature ap_support; /* Lightweight AP mode support */
|
||||
NMSupplicantFeature mac_randomization_support;
|
||||
guint32 max_scan_ssids;
|
||||
@@ -510,6 +510,15 @@ nm_supplicant_interface_set_ap_support (NMSupplicantInterface *self,
|
||||
priv->ap_support = ap_support;
|
||||
}
|
||||
|
||||
void
|
||||
nm_supplicant_interface_set_fast_support (NMSupplicantInterface *self,
|
||||
NMSupplicantFeature fast_support)
|
||||
{
|
||||
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
|
||||
|
||||
priv->fast_support = fast_support;
|
||||
}
|
||||
|
||||
static void
|
||||
set_preassoc_scan_mac_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
|
||||
{
|
||||
@@ -1302,7 +1311,8 @@ nm_supplicant_interface_set_config (NMSupplicantInterface *self,
|
||||
/* Make sure the supplicant supports EAP-FAST before trying to send
|
||||
* it an EAP-FAST configuration.
|
||||
*/
|
||||
if (nm_supplicant_config_fast_required (cfg) && !priv->fast_supported) {
|
||||
if ( priv->fast_support == NM_SUPPLICANT_FEATURE_NO
|
||||
&& nm_supplicant_config_fast_required (cfg)) {
|
||||
g_set_error (error, NM_SUPPLICANT_ERROR, NM_SUPPLICANT_ERROR_CONFIG,
|
||||
"EAP-FAST is not supported by the supplicant");
|
||||
return FALSE;
|
||||
@@ -1464,7 +1474,7 @@ nm_supplicant_interface_get_max_scan_ssids (NMSupplicantInterface *self)
|
||||
NMSupplicantInterface *
|
||||
nm_supplicant_interface_new (const char *ifname,
|
||||
NMSupplicantDriver driver,
|
||||
gboolean fast_supported,
|
||||
NMSupplicantFeature fast_support,
|
||||
NMSupplicantFeature ap_support)
|
||||
{
|
||||
g_return_val_if_fail (ifname != NULL, NULL);
|
||||
@@ -1472,7 +1482,7 @@ nm_supplicant_interface_new (const char *ifname,
|
||||
return g_object_new (NM_TYPE_SUPPLICANT_INTERFACE,
|
||||
NM_SUPPLICANT_INTERFACE_IFACE, ifname,
|
||||
NM_SUPPLICANT_INTERFACE_DRIVER, (guint) driver,
|
||||
NM_SUPPLICANT_INTERFACE_FAST_SUPPORTED, fast_supported,
|
||||
NM_SUPPLICANT_INTERFACE_FAST_SUPPORT, (int) fast_support,
|
||||
NM_SUPPLICANT_INTERFACE_AP_SUPPORT, (int) ap_support,
|
||||
NULL);
|
||||
}
|
||||
@@ -1504,9 +1514,9 @@ set_property (GObject *object,
|
||||
/* construct-only */
|
||||
priv->driver = g_value_get_uint (value);
|
||||
break;
|
||||
case PROP_FAST_SUPPORTED:
|
||||
case PROP_FAST_SUPPORT:
|
||||
/* construct-only */
|
||||
priv->fast_supported = g_value_get_boolean (value);
|
||||
priv->fast_support = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_AP_SUPPORT:
|
||||
/* construct-only */
|
||||
@@ -1597,12 +1607,14 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass)
|
||||
G_PARAM_WRITABLE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
obj_properties[PROP_FAST_SUPPORTED] =
|
||||
g_param_spec_boolean (NM_SUPPLICANT_INTERFACE_FAST_SUPPORTED, "", "",
|
||||
TRUE,
|
||||
G_PARAM_WRITABLE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
obj_properties[PROP_FAST_SUPPORT] =
|
||||
g_param_spec_int (NM_SUPPLICANT_INTERFACE_FAST_SUPPORT, "", "",
|
||||
NM_SUPPLICANT_FEATURE_UNKNOWN,
|
||||
NM_SUPPLICANT_FEATURE_YES,
|
||||
NM_SUPPLICANT_FEATURE_UNKNOWN,
|
||||
G_PARAM_WRITABLE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
obj_properties[PROP_AP_SUPPORT] =
|
||||
g_param_spec_int (NM_SUPPLICANT_INTERFACE_AP_SUPPORT, "", "",
|
||||
NM_SUPPLICANT_FEATURE_UNKNOWN,
|
||||
|
@@ -19,8 +19,8 @@
|
||||
* Copyright (C) 2007 - 2008 Novell, Inc.
|
||||
*/
|
||||
|
||||
#ifndef __NETWORKMANAGER_SUPPLICANT_INTERFACE_H__
|
||||
#define __NETWORKMANAGER_SUPPLICANT_INTERFACE_H__
|
||||
#ifndef __NM_SUPPLICANT_INTERFACE_H__
|
||||
#define __NM_SUPPLICANT_INTERFACE_H__
|
||||
|
||||
#include "nm-supplicant-types.h"
|
||||
|
||||
@@ -58,7 +58,7 @@ enum {
|
||||
#define NM_SUPPLICANT_INTERFACE_SCANNING "scanning"
|
||||
#define NM_SUPPLICANT_INTERFACE_CURRENT_BSS "current-bss"
|
||||
#define NM_SUPPLICANT_INTERFACE_DRIVER "driver"
|
||||
#define NM_SUPPLICANT_INTERFACE_FAST_SUPPORTED "fast-supported"
|
||||
#define NM_SUPPLICANT_INTERFACE_FAST_SUPPORT "fast-support"
|
||||
#define NM_SUPPLICANT_INTERFACE_AP_SUPPORT "ap-support"
|
||||
|
||||
/* Signals */
|
||||
@@ -77,7 +77,7 @@ GType nm_supplicant_interface_get_type (void);
|
||||
|
||||
NMSupplicantInterface * nm_supplicant_interface_new (const char *ifname,
|
||||
NMSupplicantDriver driver,
|
||||
gboolean fast_supported,
|
||||
NMSupplicantFeature fast_support,
|
||||
NMSupplicantFeature ap_support);
|
||||
|
||||
void nm_supplicant_interface_set_supplicant_available (NMSupplicantInterface *self,
|
||||
@@ -119,4 +119,7 @@ NMSupplicantFeature nm_supplicant_interface_get_ap_support (NMSupplicantInterfac
|
||||
void nm_supplicant_interface_set_ap_support (NMSupplicantInterface *self,
|
||||
NMSupplicantFeature apmode);
|
||||
|
||||
#endif /* NM_SUPPLICANT_INTERFACE_H */
|
||||
void nm_supplicant_interface_set_fast_support (NMSupplicantInterface *self,
|
||||
NMSupplicantFeature fast_support);
|
||||
|
||||
#endif /* __NM_SUPPLICANT_INTERFACE_H__ */
|
||||
|
@@ -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,7 +217,7 @@ 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)) {
|
||||
@@ -227,7 +227,7 @@ update_capabilities (NMSupplicantManager *self)
|
||||
|
||||
for (a = array; *a; a++) {
|
||||
if (g_ascii_strcasecmp (*a, "FAST") == 0) {
|
||||
priv->fast_supported = TRUE;
|
||||
priv->fast_support = NM_SUPPLICANT_FEATURE_YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -237,7 +237,12 @@ update_capabilities (NMSupplicantManager *self)
|
||||
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
|
||||
@@ -332,7 +337,8 @@ name_owner_cb (GDBusProxy *proxy, GParamSpec *pspec, gpointer user_data)
|
||||
|
||||
set_running (self, FALSE);
|
||||
|
||||
priv->fast_supported = FALSE;
|
||||
priv->ap_support = NM_SUPPLICANT_FEATURE_UNKNOWN;
|
||||
priv->fast_support = NM_SUPPLICANT_FEATURE_UNKNOWN;
|
||||
}
|
||||
|
||||
g_free (owner);
|
||||
|
Reference in New Issue
Block a user