networkctl: Display DHCP4 client ID

This commit is contained in:
Susant Sahani 2020-06-08 06:40:23 +02:00
parent daec96821d
commit 2153bbc81a
1 changed files with 11 additions and 1 deletions

View File

@ -1381,7 +1381,7 @@ static int link_status_one(
_cleanup_strv_free_ char **dns = NULL, **ntp = NULL, **sip = NULL, **search_domains = NULL, **route_domains = NULL,
**pop3_server = NULL, **smtp_server = NULL, **lpr_server = NULL;
_cleanup_free_ char *setup_state = NULL, *operational_state = NULL, *tz = NULL;
_cleanup_free_ char *t = NULL, *network = NULL;
_cleanup_free_ char *t = NULL, *network = NULL, *client_id = NULL;
const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL, *link = NULL;
const char *on_color_operational, *off_color_operational,
*on_color_setup, *off_color_setup;
@ -2073,6 +2073,16 @@ static int link_status_one(
return table_log_add_error(r);
}
r = sd_network_link_get_dhcp4_client_id_string(info->ifindex, &client_id);
if (r >= 0) {
r = table_add_many(table,
TABLE_EMPTY,
TABLE_STRING, "DHCP4 Client ID:",
TABLE_STRING, client_id);
if (r < 0)
return table_log_add_error(r);
}
r = dump_lldp_neighbors(table, "Connected To:", info->ifindex);
if (r < 0)
return r;