dhcp: improve logging for DHCPv6 merged leases

Instead of logging the event-id, which is composed from options that
are already visible in the log, it's more interesting to log that the
lease was merged.
This commit is contained in:
Beniamino Galvani 2022-04-13 09:04:32 +02:00
parent e5d4194673
commit f20ac6bdc7
2 changed files with 1 additions and 28 deletions

View file

@ -291,6 +291,7 @@ nm_dhcp_client_set_state(NMDhcpClient *self, NMDhcpState new_state, const NML3Co
if (!IS_IPv4 && l3cd) {
if (nm_dhcp_utils_merge_new_dhcp6_lease(priv->l3cd, l3cd, &l3cd_merged)) {
_LOGD("lease merged with existing one");
l3cd = nm_l3_config_data_seal(l3cd_merged);
}
}
@ -327,14 +328,6 @@ nm_dhcp_client_set_state(NMDhcpClient *self, NMDhcpState new_state, const NML3Co
keys[i],
(char *) g_hash_table_lookup(options, keys[i]));
}
if (priv->config.addr_family == AF_INET6) {
gs_free char *event_id = NULL;
event_id = nm_dhcp_utils_get_dhcp6_event_id(options);
if (event_id)
_LOGT("event-id: \"%s\"", event_id);
}
}
}

View file

@ -820,26 +820,6 @@ nm_dhcp_utils_get_leasefile_path(int addr_family,
return FALSE;
}
char *
nm_dhcp_utils_get_dhcp6_event_id(GHashTable *lease)
{
const char *start;
const char *iaid;
if (!lease)
return NULL;
iaid = g_hash_table_lookup(lease, "iaid");
if (!iaid)
return NULL;
start = g_hash_table_lookup(lease, "life_starts");
if (!start)
return NULL;
return g_strdup_printf("%s|%s", iaid, start);
}
gboolean
nm_dhcp_utils_merge_new_dhcp6_lease(const NML3ConfigData *l3cd_old,
const NML3ConfigData *l3cd_new,