summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-08-12 16:32:41 +0200
committerThomas Haller <thaller@redhat.com>2018-08-22 10:49:34 +0200
commit4607970288c22bebed86c287dfe1b658db9cec99 (patch)
treed00c8f7425ab7e0b0b8ccc46db57dea711e20914
parent39efc650964a3509dd8d45ce67ed171c0aa11ca7 (diff)
downloadNetworkManager-4607970288c22bebed86c287dfe1b658db9cec99.tar.gz
wifi/olpc: fix setting SSID for OLPC mesh in complete_connection()
NM_SETTING_OLPC_MESH_SSID is of type GBytes, not GByteArray.
-rw-r--r--src/devices/wifi/nm-device-olpc-mesh.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/devices/wifi/nm-device-olpc-mesh.c b/src/devices/wifi/nm-device-olpc-mesh.c
index 7737f19a71..6f833635a1 100644
--- a/src/devices/wifi/nm-device-olpc-mesh.c
+++ b/src/devices/wifi/nm-device-olpc-mesh.c
@@ -95,7 +95,6 @@ complete_connection (NMDevice *device,
GError **error)
{
NMSettingOlpcMesh *s_mesh;
- GByteArray *tmp;
s_mesh = nm_connection_get_setting_olpc_mesh (connection);
if (!s_mesh) {
@@ -104,10 +103,10 @@ complete_connection (NMDevice *device,
}
if (!nm_setting_olpc_mesh_get_ssid (s_mesh)) {
- tmp = g_byte_array_sized_new (strlen (DEFAULT_SSID));
- g_byte_array_append (tmp, (const guint8 *) DEFAULT_SSID, strlen (DEFAULT_SSID));
- g_object_set (G_OBJECT (s_mesh), NM_SETTING_OLPC_MESH_SSID, tmp, NULL);
- g_byte_array_free (tmp, TRUE);
+ gs_unref_bytes GBytes *ssid = NULL;
+
+ ssid = g_bytes_new_static (DEFAULT_SSID, NM_STRLEN (DEFAULT_SSID));
+ g_object_set (G_OBJECT (s_mesh), NM_SETTING_OLPC_MESH_SSID, ssid, NULL);
}
if (!nm_setting_olpc_mesh_get_dhcp_anycast_address (s_mesh)) {