|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From af5effc4220dab6c4c87a130bae7be441f6967ca Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Tom Gundersen <teg@jklm.no>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Mon, 8 Sep 2014 14:18:32 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] networkctl: show the link file applied to each link
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/network/networkctl.c | 7 +++++--
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 43258bb942..b374121fbc 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/network/networkctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/network/networkctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -295,7 +295,7 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
_cleanup_udev_device_unref_ struct udev_device *d = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
char devid[2 + DECIMAL_STR_MAX(int)];
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
_cleanup_free_ char *t = NULL, *network = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL, *link = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
const char *on_color_operational, *off_color_operational,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
*on_color_setup, *off_color_setup;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
struct ether_addr e;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -384,6 +384,7 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
link_get_type_string(iftype, d, &t);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (d) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ link = udev_device_get_property_value(d, "ID_NET_LINK_FILE");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
driver = udev_device_get_property_value(d, "ID_NET_DRIVER");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
path = udev_device_get_property_value(d, "ID_PATH");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -400,9 +401,11 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
printf("%s%s%s %i: %s\n", on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational, ifindex, name);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- printf("Network File: %s\n"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ printf(" Link File: %s\n"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ "Network File: %s\n"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
" Type: %s\n"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
" State: %s%s%s (%s%s%s)\n",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ strna(link),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
strna(network),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
strna(t),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
on_color_operational, strna(operational_state), off_color_operational,
|