mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 02:30:08 +01:00
device: log dns resolver state as string
This commit is contained in:
parent
ec7d8ddb29
commit
785aef7103
1 changed files with 18 additions and 2 deletions
|
|
@ -17564,6 +17564,22 @@ hostname_dns_address_timeout(gpointer user_data)
|
|||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_resolver_state_to_string(ResolverState state)
|
||||
{
|
||||
switch (state) {
|
||||
case RESOLVER_WAIT_ADDRESS:
|
||||
return "wait-address";
|
||||
case RESOLVER_IN_PROGRESS:
|
||||
return "in-progress";
|
||||
case RESOLVER_DONE:
|
||||
return "done";
|
||||
default:
|
||||
nm_assert_not_reached();
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
/* return value is valid only immediately */
|
||||
const char *
|
||||
nm_device_get_hostname_from_dns_lookup(NMDevice *self, int addr_family, gboolean *out_wait)
|
||||
|
|
@ -17635,9 +17651,9 @@ nm_device_get_hostname_from_dns_lookup(NMDevice *self, int addr_family, gboolean
|
|||
gs_free char *new_str = NULL;
|
||||
|
||||
_LOGT(LOGD_DNS,
|
||||
"hostname-from-dns: ipv%c resolver state %d, old address %s, new address %s",
|
||||
"hostname-from-dns: ipv%c resolver state %s, old address %s, new address %s",
|
||||
nm_utils_addr_family_to_char(resolver->addr_family),
|
||||
resolver->state,
|
||||
_resolver_state_to_string(resolver->state),
|
||||
resolver->address ? (old_str = g_inet_address_to_string(resolver->address))
|
||||
: "(null)",
|
||||
new_address ? (new_str = g_inet_address_to_string(new_address)) : "(null)");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue