summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-08 14:18:32 +0200
committerTom Gundersen <teg@jklm.no>2014-09-08 15:09:08 +0200
commitaf5effc4220dab6c4c87a130bae7be441f6967ca (patch)
treeb47385c3a570c05ca2b29158976980757b654338 /src/network
parentd95b83b87d7d7c50e550f7128827f73a321c8934 (diff)
networkctl: show the link file applied to each link
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 43258bb942..b374121fbc 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -295,7 +295,7 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
_cleanup_udev_device_unref_ struct udev_device *d = NULL;
char devid[2 + DECIMAL_STR_MAX(int)];
_cleanup_free_ char *t = NULL, *network = NULL;
- const char *driver = NULL, *path = NULL, *vendor = NULL, *model = 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;
struct ether_addr e;
@@ -384,6 +384,7 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
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");
path = udev_device_get_property_value(d, "ID_PATH");
@@ -400,9 +401,11 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
printf("%s%s%s %i: %s\n", on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational, ifindex, name);
- printf("Network File: %s\n"
+ printf(" Link File: %s\n"
+ "Network File: %s\n"
" Type: %s\n"
" State: %s%s%s (%s%s%s)\n",
+ strna(link),
strna(network),
strna(t),
on_color_operational, strna(operational_state), off_color_operational,