sd-dhcp-lease: use sd_dhcp_client_id

This commit is contained in:
Yu Watanabe
2024-01-03 06:06:39 +09:00
parent 1809132064
commit d59a2b3bf5
5 changed files with 30 additions and 37 deletions
+3 -4
View File
@@ -2271,8 +2271,7 @@ static int link_status_one(
}
if (lease) {
const void *client_id;
size_t client_id_len;
const sd_dhcp_client_id *client_id;
const char *tz;
r = sd_dhcp_lease_get_timezone(lease, &tz);
@@ -2284,11 +2283,11 @@ static int link_status_one(
return table_log_add_error(r);
}
r = sd_dhcp_lease_get_client_id(lease, &client_id, &client_id_len);
r = sd_dhcp_lease_get_client_id(lease, &client_id);
if (r >= 0) {
_cleanup_free_ char *id = NULL;
r = sd_dhcp_client_id_to_string_from_raw(client_id, client_id_len, &id);
r = sd_dhcp_client_id_to_string(client_id, &id);
if (r >= 0) {
r = table_add_many(table,
TABLE_FIELD, "DHCP4 Client ID",