mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-05 12:20:36 +01:00
dhcp: debug log generated DUID
This commit is contained in:
parent
1b1b4bd91c
commit
cc7e5cc591
1 changed files with 25 additions and 17 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue