summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-11-27 18:40:18 +0100
committerThomas Haller <thaller@redhat.com>2014-12-04 17:02:22 +0100
commit1e313e000dceda2bd7a753c407cc3078a37ce402 (patch)
tree0d7123dc3077d7e1c1f1f89f1558701e4699eac5 /src
parent21eb6b5d0de9656c9b6189d4d4733204b33742d8 (diff)
downloadNetworkManager-1e313e000dceda2bd7a753c407cc3078a37ce402.tar.gz
libnm: add a type argument to nm_utils_uuid_generate_from_string()
There are different types (variants) of UUIDs defined. Especially variants 3 and 5 are name based variants (rfc4122). The way we create our UUIDs in nm_utils_uuid_generate_from_string() however does not create them according to RFC and does not set the flags to indicate the variant. Modify the signature of nm_utils_uuid_generate_from_string() to accept a "uuid_type" argument, so that we later can add other algorithms without breaking API.
Diffstat (limited to 'src')
-rw-r--r--src/settings/plugins/ibft/reader.c2
-rw-r--r--src/settings/plugins/ifcfg-rh/reader.c4
-rw-r--r--src/settings/plugins/ifnet/connection_parser.c2
-rw-r--r--src/settings/plugins/ifupdown/parser.c2
-rw-r--r--src/settings/plugins/keyfile/reader.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/src/settings/plugins/ibft/reader.c b/src/settings/plugins/ibft/reader.c
index 61c4e1cfe7..ebac9607ac 100644
--- a/src/settings/plugins/ibft/reader.c
+++ b/src/settings/plugins/ibft/reader.c
@@ -408,7 +408,7 @@ connection_setting_add (const GPtrArray *block,
s_vlanid ? s_vlanid : "0",
s_hwaddr,
s_ip4addr ? s_ip4addr : "DHCP");
- uuid = nm_utils_uuid_generate_from_string (uuid_data, -1);
+ uuid = nm_utils_uuid_generate_from_string (uuid_data, -1, NM_UTILS_UUID_TYPE_LEGACY, NULL);
g_free (uuid_data);
s_con = nm_setting_connection_new ();
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c
index 52dee9d5e5..145a0a3915 100644
--- a/src/settings/plugins/ifcfg-rh/reader.c
+++ b/src/settings/plugins/ifcfg-rh/reader.c
@@ -148,7 +148,7 @@ make_connection_setting (const char *file,
uuid = svGetValue (ifcfg, "UUID", FALSE);
if (!uuid || !strlen (uuid)) {
g_free (uuid);
- uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName, -1);
+ uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName, -1, NM_UTILS_UUID_TYPE_LEGACY, NULL);
}
g_object_set (s_con,
@@ -4588,7 +4588,7 @@ uuid_from_file (const char *filename)
uuid = svGetValue (ifcfg, "UUID", FALSE);
if (!uuid || !strlen (uuid)) {
g_free (uuid);
- uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName, -1);
+ uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName, -1, NM_UTILS_UUID_TYPE_LEGACY, NULL);
}
svCloseFile (ifcfg);
diff --git a/src/settings/plugins/ifnet/connection_parser.c b/src/settings/plugins/ifnet/connection_parser.c
index ba76579a12..41baf31507 100644
--- a/src/settings/plugins/ifnet/connection_parser.c
+++ b/src/settings/plugins/ifnet/connection_parser.c
@@ -1629,7 +1629,7 @@ ifnet_update_connection_from_config_block (const char *conn_name,
id = connection_id_from_ifnet_name (conn_name);
uuid = g_strdup (ifnet_get_data (conn_name, "uuid"));
if (!uuid)
- uuid = nm_utils_uuid_generate_from_string (id, -1);
+ uuid = nm_utils_uuid_generate_from_string (id, -1, NM_UTILS_UUID_TYPE_LEGACY, NULL);
g_object_set (setting,
NM_SETTING_CONNECTION_TYPE, type,
diff --git a/src/settings/plugins/ifupdown/parser.c b/src/settings/plugins/ifupdown/parser.c
index 9af11976c8..15081a4c59 100644
--- a/src/settings/plugins/ifupdown/parser.c
+++ b/src/settings/plugins/ifupdown/parser.c
@@ -686,7 +686,7 @@ ifupdown_update_connection_from_if_block (NMConnection *connection,
idstr = g_strconcat ("Ifupdown (", block->name, ")", NULL);
uuid_base = idstr;
- uuid = nm_utils_uuid_generate_from_string (uuid_base, -1);
+ uuid = nm_utils_uuid_generate_from_string (uuid_base, -1, NM_UTILS_UUID_TYPE_LEGACY, NULL);
g_object_set (s_con,
NM_SETTING_CONNECTION_TYPE, type,
NM_SETTING_CONNECTION_INTERFACE_NAME, block->name,
diff --git a/src/settings/plugins/keyfile/reader.c b/src/settings/plugins/keyfile/reader.c
index 94982cef39..9dc0a7b4aa 100644
--- a/src/settings/plugins/keyfile/reader.c
+++ b/src/settings/plugins/keyfile/reader.c
@@ -1316,7 +1316,7 @@ nm_keyfile_plugin_connection_from_file (const char *filename, GError **error)
if (!nm_setting_connection_get_uuid (s_con)) {
char *hashed_uuid;
- hashed_uuid = nm_utils_uuid_generate_from_string (filename, -1);
+ hashed_uuid = nm_utils_uuid_generate_from_string (filename, -1, NM_UTILS_UUID_TYPE_LEGACY, NULL);
g_object_set (s_con, NM_SETTING_CONNECTION_UUID, hashed_uuid, NULL);
g_free (hashed_uuid);
}