summaryrefslogtreecommitdiff
path: root/src/supplicant/nm-supplicant-interface.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-01-05 14:27:27 +0100
committerThomas Haller <thaller@redhat.com>2020-02-10 19:11:50 +0100
commitc5e0bae8b437e26f7359326065f646b8f1e68c54 (patch)
tree805d6abffcb9b477f14385fe33bf25a9237ffef4 /src/supplicant/nm-supplicant-interface.c
parent0df15330ae2c526bd14858868f7330ac08f9cf1e (diff)
supplicant: track supplicant interface instances in manager via embedded CList
Diffstat (limited to 'src/supplicant/nm-supplicant-interface.c')
-rw-r--r--src/supplicant/nm-supplicant-interface.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/supplicant/nm-supplicant-interface.c b/src/supplicant/nm-supplicant-interface.c
index 6f2b9d5a3e..d7cb4728aa 100644
--- a/src/supplicant/nm-supplicant-interface.c
+++ b/src/supplicant/nm-supplicant-interface.c
@@ -102,7 +102,7 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSupplicantInterface,
PROP_AUTH_STATE,
);
-typedef struct {
+typedef struct _NMSupplicantInterfacePrivate {
char * dev;
NMSupplicantDriver driver;
gboolean has_credreq; /* Whether querying 802.1x credentials is supported */
@@ -149,18 +149,13 @@ typedef struct {
} NMSupplicantInterfacePrivate;
-struct _NMSupplicantInterface {
- GObject parent;
- NMSupplicantInterfacePrivate _priv;
-};
-
struct _NMSupplicantInterfaceClass {
GObjectClass parent;
};
G_DEFINE_TYPE (NMSupplicantInterface, nm_supplicant_interface, G_TYPE_OBJECT)
-#define NM_SUPPLICANT_INTERFACE_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMSupplicantInterface, NM_IS_SUPPLICANT_INTERFACE)
+#define NM_SUPPLICANT_INTERFACE_GET_PRIVATE(self) _NM_GET_PRIVATE_PTR (self, NMSupplicantInterface, NM_IS_SUPPLICANT_INTERFACE)
/*****************************************************************************/
@@ -2742,7 +2737,13 @@ set_property (GObject *object,
static void
nm_supplicant_interface_init (NMSupplicantInterface * self)
{
- NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+ NMSupplicantInterfacePrivate *priv;
+
+ priv = G_TYPE_INSTANCE_GET_PRIVATE (self, NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterfacePrivate);
+
+ self->_priv = priv;
+
+ c_list_init (&self->supp_lst);
nm_assert (priv->global_capabilities == NM_SUPPL_CAP_MASK_NONE);
nm_assert (priv->iface_capabilities == NM_SUPPL_CAP_MASK_NONE);
@@ -2775,6 +2776,8 @@ dispose (GObject *object)
NMSupplicantInterface *self = NM_SUPPLICANT_INTERFACE (object);
NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
+ nm_assert (c_list_is_empty (&self->supp_lst));
+
nm_supplicant_interface_cancel_wps (self);
if (priv->wps_data) {
/* we shut down, but an asynchronous Cancel request is pending.
@@ -2824,7 +2827,9 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->dispose = dispose;
+ g_type_class_add_private (object_class, sizeof (NMSupplicantInterfacePrivate));
+
+ object_class->dispose = dispose;
object_class->set_property = set_property;
object_class->get_property = get_property;