summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-01-05 16:39:17 +0100
committerThomas Haller <thaller@redhat.com>2020-02-10 19:11:50 +0100
commit6cb728e977cb4980ccc78d3441274dca0573cc45 (patch)
tree2da657be74896ec1103c6f362dedbc7d11cd8c90
parentc5e0bae8b437e26f7359326065f646b8f1e68c54 (diff)
supplicant: use nm_utils_gbytes_to_variant_ay() in nm_supplicant_manager_set_wfd_ies()
-rw-r--r--src/supplicant/nm-supplicant-manager.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/supplicant/nm-supplicant-manager.c b/src/supplicant/nm-supplicant-manager.c
index 1bcb23eec..65b910cad 100644
--- a/src/supplicant/nm-supplicant-manager.c
+++ b/src/supplicant/nm-supplicant-manager.c
@@ -149,7 +149,6 @@ nm_supplicant_manager_set_wfd_ies (NMSupplicantManager *self,
{
NMSupplicantManagerPrivate *priv;
GVariantBuilder params;
- GVariant *val;
g_return_if_fail (NM_IS_SUPPLICANT_MANAGER (self));
@@ -157,20 +156,12 @@ nm_supplicant_manager_set_wfd_ies (NMSupplicantManager *self,
_LOGD ("setting WFD IEs for P2P operation");
- if (wfd_ies)
- val = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
- g_bytes_get_data (wfd_ies, NULL),
- g_bytes_get_size (wfd_ies),
- sizeof (guint8));
- else
- val = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
- NULL, 0, sizeof (guint8));
-
g_variant_builder_init (&params, G_VARIANT_TYPE ("(ssv)"));
g_variant_builder_add (&params, "s", g_dbus_proxy_get_interface_name (priv->proxy));
g_variant_builder_add (&params, "s", "WFDIEs");
- g_variant_builder_add_value (&params, g_variant_new_variant (val));
+ g_variant_builder_add_value (&params,
+ g_variant_new_variant (nm_utils_gbytes_to_variant_ay (wfd_ies)));
g_dbus_connection_call (g_dbus_proxy_get_connection (priv->proxy),
g_dbus_proxy_get_name (priv->proxy),