Commit cc7e5cc5 authored by Dan Williams's avatar Dan Williams

dhcp: debug log generated DUID

parent 1b1b4bd9
......@@ -405,23 +405,6 @@ generate_duid_from_machine_id (void)
return duid;
}
static GByteArray *
get_duid (NMDHCPClient *self)
{
static GByteArray *duid = NULL;
GByteArray *copy = NULL;
if (G_UNLIKELY (duid == NULL))
duid = generate_duid_from_machine_id ();
if (G_LIKELY (duid)) {
copy = g_byte_array_sized_new (duid->len);
g_byte_array_append (copy, duid->data, duid->len);
}
return copy;
}
static char *
escape_duid (const GByteArray *duid)
{
......@@ -439,6 +422,31 @@ escape_duid (const GByteArray *duid)
return g_string_free (s, FALSE);
}
static GByteArray *
get_duid (NMDHCPClient *self)
{
static GByteArray *duid = NULL;
GByteArray *copy = NULL;
char *escaped;
if (G_UNLIKELY (duid == NULL)) {
duid = generate_duid_from_machine_id ();
if (nm_logging_level_enabled (LOGL_DEBUG)) {
escaped = escape_duid (duid);
nm_log_dbg (LOGD_DHCP6, "Generated DUID from machine-id: %s", escaped);
g_free (escaped);
}
}
if (G_LIKELY (duid)) {
copy = g_byte_array_sized_new (duid->len);
g_byte_array_append (copy, duid->data, duid->len);
}
return copy;
}
gboolean
nm_dhcp_client_start_ip6 (NMDHCPClient *self,
NMSettingIP6Config *s_ip6,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment