]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkctl: Display DHCP4 client ID 16085/head
authorSusant Sahani <ssahani@vmware.com>
Mon, 8 Jun 2020 04:40:23 +0000 (06:40 +0200)
committerSusant Sahani <ssahani@vmware.com>
Mon, 8 Jun 2020 05:09:32 +0000 (07:09 +0200)
src/network/networkctl.c

index 59c2ed278b4ab9ea05c33a9723c51d9ab433a3d5..dea190eb0d10372e1c0726e4b114df9e09aa9566 100644 (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;