chiark / gitweb /
util: never use ether_ntoa(), since it formats with %x, not %02x, which makes etherne...
[elogind.git] / src / network / networkctl.c
index 25097bbdf1d156c6785229e4900bdd4eb43b9618..33fe8bfc6103d91de4b80bbfe52f12306804f74d 100644 (file)
@@ -33,6 +33,7 @@
 #include "udev-util.h"
 #include "arphrd-list.h"
 #include "local-addresses.h"
+#include "socket-util.h"
 
 static bool arg_no_pager = false;
 static bool arg_legend = true;
@@ -215,7 +216,7 @@ static int list_links(char **args, unsigned n) {
         }
 
         if (arg_legend)
-                printf("%3s %-16s %-10s %-11s %-10s\n", "IDX", "LINK", "TYPE", "OPERATIONAL", "SETUP");
+                printf("%3s %-16s %-18s %-11s %-10s\n", "IDX", "LINK", "TYPE", "OPERATIONAL", "SETUP");
 
         c = decode_and_sort_links(reply, &links);
         if (c < 0)
@@ -240,7 +241,7 @@ static int list_links(char **args, unsigned n) {
 
                 link_get_type_string(links[i].iftype, d, &t);
 
-                printf("%3i %-16s %-10s %s%-11s%s %s%-10s%s\n",
+                printf("%3i %-16s %-18s %s%-11s%s %s%-10s%s\n",
                        links[i].ifindex, links[i].name, strna(t),
                        on_color_operational, strna(operational_state), off_color_operational,
                        on_color_setup, strna(setup_state), off_color_setup);
@@ -402,8 +403,10 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
         if (model)
                 printf("       Model: %s\n", model);
 
-        if (have_mac)
-                printf("  HW Address: %s\n", ether_ntoa(&e));
+        if (have_mac) {
+                char ea[ETHER_ADDR_TO_STRING_MAX];
+                printf("  HW Address: %s\n", ether_addr_to_string(&e, ea));
+        }
 
         if (mtu > 0)
                 printf("         MTU: %u\n", mtu);