chiark / gitweb /
journal: add debug mode for mmap-cache (--enable-debug=mmap-cache)
[elogind.git] / src / network / networkctl.c
index 3760de71dd2056762bb4af424ea40ae07fb4456e..b56a728d5e24daf7eb07ff320aa7683238adb3de 100644 (file)
@@ -580,9 +580,6 @@ static int link_status_one(
 
         sprintf(devid, "n%i", ifindex);
         d = udev_device_new_from_device_id(udev, devid);
-
-        link_get_type_string(iftype, d, &t);
-
         if (d) {
                 link = udev_device_get_property_value(d, "ID_NET_LINK_FILE");
                 driver = udev_device_get_property_value(d, "ID_NET_DRIVER");
@@ -597,6 +594,8 @@ static int link_status_one(
                         model = udev_device_get_property_value(d, "ID_MODEL");
         }
 
+        link_get_type_string(iftype, d, &t);
+
         sd_network_link_get_network_file(ifindex, &network);
 
         printf("%s%s%s %i: %s\n", on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational, ifindex, name);
@@ -670,13 +669,14 @@ static int link_status(char **args, unsigned n) {
         if (n <= 1 && !arg_all) {
                 _cleanup_free_ char *operational_state = NULL;
                 _cleanup_strv_free_ char **dns = NULL, **ntp = NULL, **domains = NULL;
-                _cleanup_free_ struct local_address *addresses = NULL;
                 const char *on_color_operational, *off_color_operational;
 
                 sd_network_get_operational_state(&operational_state);
                 operational_state_to_color(operational_state, &on_color_operational, &off_color_operational);
 
-                printf("       State: %s%s%s\n", on_color_operational, strna(operational_state), off_color_operational);
+                printf("%s%s%s      State: %s%s%s\n",
+                       on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational,
+                       on_color_operational, strna(operational_state), off_color_operational);
 
                 dump_addresses(rtnl, "     Address: ", 0);
                 dump_gateways(rtnl, hwdb, "     Gateway: ", 0);