]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkctl: Display DHCP6 DUID 16124/head
authorSusant Sahani <ssahani@vmware.com>
Tue, 9 Jun 2020 14:49:48 +0000 (16:49 +0200)
committerSusant Sahani <ssahani@vmware.com>
Wed, 10 Jun 2020 17:21:24 +0000 (19:21 +0200)
src/network/networkctl.c

index d4a5b52309fa1b9be17143c4105c03ab87833267..f7c48f19b1caedc219001e39a724c839b2abe586 100644 (file)
@@ -1380,9 +1380,9 @@ 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, *client_id = NULL, *iaid = NULL;
+        _cleanup_free_ char *t = NULL, *network = NULL, *client_id = NULL, *iaid = NULL, *duid = NULL;
         const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL, *link = NULL;
+        _cleanup_free_ char *setup_state = NULL, *operational_state = NULL, *tz = NULL;
         const char *on_color_operational, *off_color_operational,
                 *on_color_setup, *off_color_setup;
         _cleanup_free_ int *carrier_bound_to = NULL, *carrier_bound_by = NULL;
@@ -2093,6 +2093,16 @@ static int link_status_one(
                         return table_log_add_error(r);
         }
 
+        r = sd_network_link_get_dhcp6_client_duid_string(info->ifindex, &duid);
+        if (r >= 0) {
+                r = table_add_many(table,
+                                   TABLE_EMPTY,
+                                   TABLE_STRING, "DHCP6 Client DUID:",
+                                   TABLE_STRING, duid);
+                if (r < 0)
+                        return table_log_add_error(r);
+        }
+
         r = dump_lldp_neighbors(table, "Connected To:", info->ifindex);
         if (r < 0)
                 return r;